Updating to 4.1.1 caused import error
See original GitHub issueI upgraded from 4.0.0 to 4.1.1, and got the following error when building my project:
import { createMakeStyles } from "./makeStyles";
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Object.compileFunction (node:vm:360:18)
at wrapSafe (node:internal/modules/cjs/loader:1049:15)
at Module._compile (node:internal/modules/cjs/loader:1084:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1174:10)
at Module.load (node:internal/modules/cjs/loader:998:32)
at Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1022:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/Users/dru/code/fitted/frontend-retailer-portal-test/frontend-retailer-portal/node_modules/@fitted/shared/dist/utils/make-styles.js:4:21)
at Module._compile (node:internal/modules/cjs/loader:1120:14) {
type: 'SyntaxError'
}
Node.js v18.6.0
I did not try 4.1.0
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:21 (9 by maintainers)
Top Results From Across the Web
Upgrading to ESX/ESXi 4.1 Update 1 using VMware Update ...
You see this error in the Update Manager GUI when using an Upgrade Baseline: Failed to import data. Cannot verify checksum for imported...
Read more >upgrade from 4.0 to 4.1 breaks dom0 update ... - GitHub
upgrade from 4.0 to 4.1 breaks dom0 update -- [ERROR ] Failed to import module localemod #7114. C: dist upgrade The code and...
Read more >ORA-02291 Error When Importing 4.1.x Page ... - Oracle Support
Developers are receiving an ORA-02291 error trying to export a page to an APEX 5.0.0 environment. The same process, same import script ran ......
Read more >QRadar: Upgrading to UBA 4.1.0 can lead to aspects of ... - IBM
Symptom · The User Imports page fails to load and an 'Unable to get imports from database' error is displayed. · The Rules...
Read more >python - pipenv install error ImportError: cannot import name ...
The main cause sees to be an import error, but I can't find anything called ensure_file_on_disk . I have tried to uninstall and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I see the problem, it’s something else
@garronej I believe this is due to the
module
being removed from thetsconfig.json
. This would change the value from"CommonJS"
to the default (which is"ES6"
/"ES2015"
for when the target is not"ES3"
or"ES5"
).So, I think to solve, the
commonjs
build just needs to set themodule
option back to"CommonJS"