Getting `Unexpected token import` error for dynamic import

I use enzyme & jest for executing tests.
Even though I use syntax-dynamic-import plugin, I am still getting the token error when I execute tests.

But, When I build the code, I didn’t get any error.

This is how my .babelrc looks,

{
  "presets": ["es2015","react"],
  "plugins": ["transform-object-rest-spread", "syntax-dynamic-import"]
}

Author: Fantashit

1 thought on “Getting `Unexpected token import` error for dynamic import

Comments are closed.