Atom Quokka plugin error: Unexpected token import when importing a module written with ES6 -

461 Views Asked by At

I am trying to use the wonderful Quokka package by WallabyJS https://github.com/wallabyjs/atom-quokka.

I am trying to import an ES6 module but keep getting an error in the Quokka console:

Unexpected token import at createScript vm.js:56

I have tried updating my package.json file and set babel: true as advised in the configuration page here but i still get the error.

Link to my package.json file here

enter image description here

1

There are 1 best solutions below

1
On

You need to specify react-app preset in your Quokka config, so instead of "babel: true", you need:

babel: {
    presets: ['react-app']
}