Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
module: add note when cjs loader throws error #28950
subsystem: module: add note to error when import,export is detected.
These will allow users to know how to change their project to support
I've been working with @gntem as part of the mentorship program and one of the projects we discussed was seeing if we could improve the error messages for using ES modules in Node.js to provide easier onboarding.
Currently if you write a Node.js module say
With this PR, the above error message instead becomes:
Providing the actionable information to the user to use modules in Node.js.
The tricky case here was catching invalid import syntax as that throws a different unexpected token message depending on the syntax as dynamic