Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

with-preact example doesn't work with next 8.0.0 #6265

Closed
willross opened this issue Feb 12, 2019 · 10 comments
Closed

with-preact example doesn't work with next 8.0.0 #6265

willross opened this issue Feb 12, 2019 · 10 comments
Assignees
Labels
good first issue Easy to fix issues, good for newcomers

Comments

@willross
Copy link

willross commented Feb 12, 2019

Bug report

Describe the bug

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)

To Reproduce

npx create-next-app --example using-preact using-preact-app && cd using-preact-app && npm run build && npm run start

Expected behavior

createContext should be polyfilled perhaps like in this example.

@toshi1127
Copy link
Contributor

@timneutkens
@willross
I am worried about PR to OSS for the first time, but I hope it makes sense!
vercel/next-plugins#400

@timneutkens
Copy link
Member

timneutkens commented Feb 13, 2019

@toshi1127 looks like a great PR! Just had one comment 🙏

@Timer Timer self-assigned this Feb 14, 2019
@Timer
Copy link
Member

Timer commented Feb 14, 2019

PR merged.

@breuerfelix
Copy link

#6764 error still here

@shashkovdanil
Copy link
Contributor

Yes, error still

@sievan
Copy link

sievan commented Apr 17, 2019

@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)

@LukasBombach
Copy link

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 -> #7231

@gu-stav
Copy link

gu-stav commented Aug 5, 2019

@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

@LukasBombach
Copy link

Yeah! So awesome! Kudos to everyone involved!

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Easy to fix issues, good for newcomers
Projects
None yet
Development

No branches or pull requests

10 participants