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

Unexpected Token 'import' #10

Closed
ghost opened this issue May 17, 2016 · 5 comments
Closed

Unexpected Token 'import' #10

ghost opened this issue May 17, 2016 · 5 comments

Comments

@ghost
Copy link

ghost commented May 17, 2016

Getting this error when running my project after adding this dependency. We're running babel (stage-2). Any idea why this is happening?

@vitalets
Copy link
Owner

hi @dustinsavery

  1. do you use also preset-es2015 ?
  2. do you use import/export in your own code?

@fab1an
Copy link

fab1an commented May 22, 2016

I have the same problem. It has to do that babel doesn't transpile dependencies in node_modules. Those should be transpiled into a lib folder or similar before publishing!

(See here: http://stackoverflow.com/a/31822668/342947
and here: http://jamesknelson.com/writing-npm-packages-with-es6-using-the-babel-6-cli/)

@vitalets
Copy link
Owner

thanks @fab1an! Will fix it.

@fab1an
Copy link

fab1an commented May 31, 2016

Check the referenced bug first, it's not easy to depend on react-native atm.

@vitalets
Copy link
Owner

vitalets commented Mar 5, 2017

All example are working on actual version of RN.
Feel free to reopen if bug still exists.

@vitalets vitalets closed this as completed Mar 5, 2017
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