[NEXT-781] strict mode error for projects that do not specify "type": "module"
#34796
Open
1 task done
"type": "module"
#34796
Verify canary release
Provide environment information
What browser are you using? (if relevant)
Chrome
How are you deploying your application? (if relevant)
No response
Describe the Bug
In
next dev
, Non-ESM files default tostrict mode
in projects that do not specify"type": "module"
in package.jsonTherefore, the non-ESM script is trapped by the strict mode validation and an error occurs.
babel error:
swc error:
In the case of babel-loader, this problem can be avoided by changing the extension from
js
tocjs
. However, for swc, this problem cannot be avoided with either extension.This problem occurs at
next@12.1.0
. Possible causes of PR: #33637Expected Behavior
next dev
works without error.To Reproduce
npx create-next-app@latest
npm run dev
NEXT-781
The text was updated successfully, but these errors were encountered: