with-preact example throws the following error:
exports.HeadManagerContext = React.createContext(null);
^
TypeError: React.createContext is not a function
at Object.<anonymous> (/home/user/next-preact/using-preact-app/node_modules/next-server/dist/lib/head-manager-context.js:11:36)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/user/next-preact/using-preact-app/node_modules/next-server/dist/lib/head.js:8:32)
at Module._compile (module.js:653:30)
npx create-next-app --example using-preact using-preact-app && cd using-preact-app && npm run build && npm run start
createContext should be polyfilled perhaps like in this example.
@timneutkens
@willross
I am worried about PR to OSS for the first time, but I hope it makes sense!
https://github.com/zeit/next-plugins/pull/400
@toshi1127 looks like a great PR! Just had one comment 🙏
PR merged.
Yes, error still
@Timer @timneutkens @toshi1127 The new version of @zeit/next-preact doesn't seem to have been published on NPM (canary version is still 0.1.1-canary.0)
This bug goes deeper than that. The real issue is that Next is no longer compatible with Preact because it uses Suspense, which, as of now, is not implemented in Preact -> https://github.com/zeit/next.js/issues/7231
@LukasBombach It seems that Preact will support Suspense and lazy in the upcoming version, so it should be 100% compatible again ✨
https://github.com/preactjs/preact/releases/tag/10.0.0-beta.2
Yeah! So awesome! Kudos to everyone involved!
Most helpful comment
@Timer @timneutkens @toshi1127 The new version of
@zeit/next-preactdoesn't seem to have been published on NPM (canary version is still 0.1.1-canary.0)