deku icon indicating copy to clipboard operation
deku copied to clipboard

ParseError: 'import' and 'export' may appear only with 'sourceType: module'

Open hajiz opened this issue 8 years ago • 1 comments

Hi team,

I cloned this repository for the first time, then ran npm install, was successful but when I run npm run example:basic I get the following error:

> [email protected] example:basic <path>/deku
> budo examples/basic/index.js -- -t babelify

[0000] info  Server running at http://<ip:port>/ (connect)

<path>/deku/examples/basic/index.js:1
import { createApp } from '../../src';
^
ParseError: 'import' and 'export' may appear only with 'sourceType: module'

Any idea of what might be happening? Can it be a library version, e.g. Babel?

Thanks

hajiz avatar Mar 05 '17 23:03 hajiz

missing BABEL_ENV in package.json causes this. Try this:

./node_modules/.bin/cross-env BABEL_ENV=commonjs npm run example:basic

it works for me.

pocka avatar Mar 08 '17 04:03 pocka