Cannot use import statement outside a module for react-kapsule from react-force-graph-2d
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:
- Run tests
Expected behavior No error
Screenshots
Desktop (please complete the following information):
- OS: Windows
Additional context
@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.
@vasturiano I use import like this
Could you give an example how should I do import?
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.
Following as I get the same error on MacOS