Skip to content
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: Cannot use import statement outside a module #9753

Open
zombieJ opened this issue Nov 21, 2024 · 3 comments
Open

Error: Cannot use import statement outside a module #9753

zombieJ opened this issue Nov 21, 2024 · 3 comments
Labels

Comments

@zombieJ
Copy link

zombieJ commented Nov 21, 2024

Describe the bug

PR #9746 add import of Assumptions but not support in node by default:

fatal - Error: Cannot use import statement outside a module
  import { Assumptions } from "./assumptions";
  ^^^^^^
  
  SyntaxError: Cannot use import statement outside a module
      at internalCompileFunction (node:internal/vm:76:[18])
      at wrapSafe (node:internal/modules/cjs/loader:1283:20)
      at Module._compile (node:internal/modules/cjs/loader:1328:27)
      at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)

It can be reproduce with bun install:

Input code

No response

Config

No response

Playground link (or link to the minimal reproduction)

https://github.com/ant-design/ant-design/actions/runs/11945315620/job/33297778540

SWC Info output

No response

Expected behavior

Work as prev version.

Actual behavior

No response

Version

0.1.16

Additional context

No response

@HomyeeKing
Copy link

it blames to the @swc/types , in my case , the error message is Error: Cannot find module '@swc/types' and @swc/types@0.1.12 works

@zombieJ
Copy link
Author

zombieJ commented Nov 21, 2024

@HomyeeKing thx for notice. Lock to 0.1.12 back to work : )

@kdy1
Copy link
Member

kdy1 commented Nov 21, 2024

Should be fixed by #9754

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants