Preact Error on next 12
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",
ReactHustle
Full Tutorial: How to Speed Up your NextJS App with Preact | ReactH...
If you have a nextjs blog or website, you would want to speed it up by reducing your bundle size. One way to drastically reduce bundle size is to replace react with preact.
0 Replies