-
Hello, I am trying to run my JS code that runs in the browser also server side inside rspec tests using mini_racer.
I have a syntax error with some files, where on the top I use the import statement to load some images:
If I run the JS code inside an rspec test I get the following error:
Does anyone have some idea how to solve this? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
I have searched a bit and I have found that probably is NodeJS that needs some configuration.
|
Beta Was this translation helpful? Give feedback.
-
I think the error is misleading: Currently, mini_racer does not support ES6 modules and Keep in mind, |
Beta Was this translation helpful? Give feedback.
-
Thank you for the reply. |
Beta Was this translation helpful? Give feedback.
-
I was able to find the path to the specific bundle made with shakapacker/webpack for my tests.
It's very difficult to find the source of the error:
And there is no "self" in my javascript files. |
Beta Was this translation helpful? Give feedback.
I think the error is misleading: Currently, mini_racer does not support ES6 modules and
import
statement for that matter.See #126 or #143
Keep in mind,
mini_racer
is not NodeJS, it uses the same JavaScript engine (V8), but adds very little on top of it.