Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Version 6.8.0 breaks modules for me #1

Closed
damonmaria opened this issue May 23, 2016 · 6 comments
Closed

Version 6.8.0 breaks modules for me #1

damonmaria opened this issue May 23, 2016 · 6 comments

Comments

@damonmaria
Copy link

I'm using WallabyJS and 6.6.8 works fine. But 6.8.0 results in:

import { shallow } from 'enzyme';
^^^^^^
SyntaxError: Unexpected reserved word

I stripped my .babelrc right back to just the following and the problem is still there:

{
  "presets": [
    "meteor"
  ]
}

I see that the commit between those 2 versions removed transform-es2015-modules-commonjs. So I added that in to my package.json and .babelrc:

  "plugins": [
    "transform-es2015-modules-commonjs"
  ],

But still no luck. import still doesn't work.

Any ideas?

@benjamn
Copy link
Contributor

benjamn commented May 23, 2016

Do you have babel-plugin-transform-es2015-modules-commonjs installed in your node_modules?

@damonmaria
Copy link
Author

Yes. Turns out I do. Running npm list I get it through:

├─┬ @kadira/storybook@1.27.0
│ ├─┬ babel-preset-es2015@6.9.0
│ │ ├─┬ babel-plugin-transform-es2015-modules-commonjs@6.8.0

@damonmaria
Copy link
Author

So I tried removing @kadira/storybook and then installing 6.8.1 again. A check with npm list showed that babel-plugin-transform-es2015-modules-commonjs wasn't installed anywhere. But I still get the same Unexpected reserved word on import.

Any other suggestions of what to try?

@benjamn
Copy link
Contributor

benjamn commented May 24, 2016

You probably want to depend directly on babel-plugin-transform-es2015-modules-commonjs by doing meteor npm install --save-dev babel-plugin-transform-es2015-modules-commonjs in your app.

@damonmaria
Copy link
Author

I had tried that already and just tried again with no luck. Still the same error of not recognising import. What in babel-preset-meteor's dependencies provides ES2015 modules?

@damonmaria
Copy link
Author

I hear that Meteor 1.3.3 will bring back .babelrc. Will this preset become the default for that .babelrc, or will the need for this go away. Simply asking because it would might make this issue obsolete.

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

No branches or pull requests

2 participants