Skip to content

Support ES modules in next.config.js #80

Closed
@ehmicky

Description

@ehmicky

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions