-
-
Notifications
You must be signed in to change notification settings - Fork 525
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
Error [ERR_UNKNOWN_FILE_EXTENSION] on latest version of MSW (v0.48.2) #1455
Comments
Related: TypeError: Module "file:///project/node_modules/statuses/codes.json" needs an import assertion of type "json" when using with an Playwright |
I tried upgrading to node 18 I also get this error
|
Hey. Thanks for reporting this. What's the recommended way of including JSON files as dependencies in ESM? This is not the library-specific problem. |
I think the simplest way is probably to inline a js object instead. There are import assertions as an option, but I don't think support is there for most tooling yet https://github.com/tc39/proposal-import-assertions Inlining at build time should avoid issues |
Would somebody please open a pull request to our esbuild config to inline |
|
Released: v0.48.3 🎉This has been released in v0.48.3! Make sure to always update to the latest version ( Predictable release automation by @ossjs/release. |
Prerequisites
Environment check
msw
versionNode.js version
v16.14.2
Reproduction repository
vercel/next.js example: with-msw
Reproduction steps
yarn create next-app --example with-msw with-msw-app cd with-msw-app yarn dev
Current behavior
There is an ESM related error in the terminal.
Expected behavior
No error in the terminal
Comment
I am not looking for a temporary fix such as, forcing next to NOT use ESM modules in packages.
The text was updated successfully, but these errors were encountered: