Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data.js refuses to compile with Babel #1

Open
hew opened this issue Jun 30, 2015 · 1 comment
Open

data.js refuses to compile with Babel #1

hew opened this issue Jun 30, 2015 · 1 comment

Comments

@hew
Copy link
Owner

hew commented Jun 30, 2015

If you try to convert data.js into ES6, the compiler chokes at the first import statement used. No idea why this would happen. I searched around for a while and came across a few similar issues, all with Webpack/React, but I didn't find anything particular to my case.

This works
var cssnext = require('cssnext')

This does not
import cssnext from 'cssnext'

So weird.

import cssnext from 'cssnext'
^^^^^^
SyntaxError: Unexpected reserved word
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/DeadFamous_AD2/Sites/yet-another/webpack.config.js:2:12)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at module.exports (/usr/local/lib/node_modules/webpack/bin/convert-argv.js:56:13)
    at Object.<anonymous> (/usr/local/lib/node_modules/webpack/bin/webpack.js:54:40)
@oliverbenns
Copy link

Because you're only compiling the app Javascript. You're not actually using compiling the Webpack Js itself. So you're using node's ES6, which way behind the spec unlike Babel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants