Home App Docs Blog Github

Next.js with Preact


Do you have any plans to support Nextjs with Preact? It works in development but when building for production, it throws this error on prerendering:
Error: [object Object] is not a valid HTML tag name in <[object Object]> at b (/Users/markpinero/Code/builder/examples/next-js-simple/node_modules/preact-render-to-string/dist/commonjs.js:1:3989)

Hi @markpinero, thanks for reporting this, do you mind sharing reproduction steps, a codesandbox, or a github repo and we’ll take a look.

Steps to reproduce:

  1. follow preact implementation here: GitHub - preactjs/next-plugin-preact: Next.js plugin for preact X
  2. run build script

CodeSandbox link: throbbing-moon-4wct8 - CodeSandbox
Github repo: GitHub - markpinero/builder-preact

1 Like

Hi @markpinero, thanks for sharing clear reproduction steps, turned out preact is actually supported but I think the next-plugin-preact is not working correctly here, we do have our own marketing site running on preact and next.js, you can take a look here on how we configured it: builder/next.config.js at master · BuilderIO/builder · GitHub

1 Like