Next.js Discord

Discord Forum

Preact Error

Unanswered
Alligator mississippiensis posted this in #help-forum
Open in Discord
Alligator mississippiensisOP
On next 12, I tried to switch to Preact, using the following guide:
https://reacthustle.com/blog/how-to-speed-up-your-nextjs-app-with-preact

But I get this error:
Cannot read properties of undefined (reading '__H')

The error seems to refer to a mix of CJS with ESM bundles, but I tried to fix it as specified in this guide, and it didn't work.

How my package.json looks:
"next-plugin-preact": "^3.0.7",
"preact": "^10.15.1",
"preact-render-to-string": "^6.1.0",
"react": "npm:@preact/compat@^17.1.2",
"react-dom": "npm:@preact/compat@^17.1.2",

0 Replies