-
Notifications
You must be signed in to change notification settings - Fork 94
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
SyntaxError: Cannot use import statement outside a module #48
Comments
Hey, I have the same problem. Did you found a solution ? |
Ran into the same issue while using next.js I was able to resolve it by replacing the lines with common js syntax import EventEmitter from 'eventemitter3'; with const EventEmitter = require('eventemitter3'); Doing the same with all imports in the module and replacing was able to resolve the issue for me. |
If you are using next.js make sure, you don't use anything in global context from @project-serum\sol-wallet-adapter e.g.:
shouldn't be called on top level of your file because next will try to call it on the server-side. |
Facing this issue as well @d-x90 should we have a |
C:\Users\Bloctech\Documents\solana\solr-token-sale\js\node_modules@project-serum\sol-wallet-adapter\dist\cjs\index.js:79
import EventEmitter from 'eventemitter3';
^^^^^^
SyntaxError: Cannot use import statement outside a module
The text was updated successfully, but these errors were encountered: