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

Support ES modules in next.config.js #80

Closed
ehmicky opened this issue Jan 8, 2021 · 1 comment
Closed

Support ES modules in next.config.js #80

ehmicky opened this issue Jan 8, 2021 · 1 comment
Labels
priority: low type: bug code to address defects in shipped code

Comments

@ehmicky
Copy link

ehmicky commented Jan 8, 2021

ES modules are only supported in Node.js 12, and import() must be used instead of require().
We currently use require() because we support Node 10.

https://github.com/netlify/netlify-plugin-nextjs/blob/59ee2bbb2ffb971e964a07245eaa478ba1c07cbd/package.json#L55

It seems like some users are trying to use ES modules in their next.config.js, which currently fails.
Bugsnag errors here, here and there.

This will be a growing problem in 3 months (April 2021) when Node 10 becomes officially unsupported.

@ehmicky ehmicky added the type: bug code to address defects in shipped code label Jan 8, 2021
@ascorbic
Copy link
Contributor

ascorbic commented Aug 5, 2021

This is an upstream issue: Next.js doesn't support it either. See vercel/next.js#9607
This should no longer show up on Bugsnag though, as it's a user build failure now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

3 participants