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 for react-kapsule from react-force-graph-2d #494

Open
chkp-maksimz opened this issue Feb 21, 2024 · 4 comments

Comments

@chkp-maksimz
Copy link

Describe the bug
Error "Cannot use import statement outside a module for react-kapsule from react-force-graph-2d"

To Reproduce
Steps to reproduce the behavior:

  1. Run tests

Expected behavior
No error

Screenshots
image
image

Desktop (please complete the following information):

  • OS: Windows

Additional context

@vasturiano
Copy link
Owner

@chkp-maksimz it looks like you're trying to import this module in a commonJs environment. This is an ES module and should be imported as such. It does not expose a commonJs entry point.

@chkp-maksimz
Copy link
Author

@vasturiano I use import like this
image
Could you give an example how should I do import?

@vasturiano
Copy link
Owner

Those imports are correct. I suppose the issue is that your tests framework is running in a commonJs environment. They need to be ES modules based.

@annette-graham
Copy link

Following as I get the same error on MacOS

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

3 participants