question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Updating to 4.1.1 caused import error

See original GitHub issue

I 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:closed
  • Created a year ago
  • Reactions:1
  • Comments:21 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
garronejcommented, Sep 7, 2022

I see the problem, it’s something else

3reactions
dvdprrshcommented, Sep 7, 2022

@garronej I believe this is due to the module being removed from the tsconfig.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 the module option back to "CommonJS"

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found