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

Cannot use import statement outside a module #221

Open
d36u9-dev opened this issue May 7, 2022 · 1 comment
Open

Cannot use import statement outside a module #221

d36u9-dev opened this issue May 7, 2022 · 1 comment

Comments

@d36u9-dev
Copy link

When I clone the repository and run npm run dev I get the following error.:

\WOKCommands\index.js:1
import WOKCommands from './src'
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1027:15)
    at Module._compile (node:internal/modules/cjs/loader:1063:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47

If I set "type": "module" in the package.json or use the .mjs extension it doesn't change the problem either.
Now if I just compile everything like this and host it locally as a packet the handler doesn't work either. So if I remove or overwrite the existing dist folder with the current unchanged code then it doesn't work at all. This must mean that the base code is different from the existing dist folder?

@tippfehlr
Copy link
Contributor

What do you want to achive by running wokcommands itself?

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

No branches or pull requests

2 participants