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

es6 in index.js breaks build in create-react-app #17

Closed
barbalex opened this issue Mar 13, 2017 · 3 comments
Closed

es6 in index.js breaks build in create-react-app #17

barbalex opened this issue Mar 13, 2017 · 3 comments

Comments

@barbalex
Copy link

barbalex commented Mar 13, 2017

in this commit: c80aa45

using an arrow function in index.js was introduced.

My project uses create-react-app. When building for production, I get an almost identical error to what is mentioned for example here: facebook/create-react-app#984:

> react-scripts build && sw-precache --config=sw-precache-config.js

Creating an optimized production build...
Failed to compile.

static/js/main.6e4ce89f.js from UglifyJs
SyntaxError: Unexpected token: operator (>) [./~/get-urls/index.js:5,0]

According to this comment the reason for the issue is that uglify can not deal with es6 and create-react-app uses uglify.

It may have been a little early to es6-ify a tool like get-urls that is used by many people when other important tools in the ecosystem like uglify can not (yet) deal with es6.

But I do see that once users have found out what is going on, there is a fairly easy solution: use an old version of get-urls.

So don't hesitate to close this issue. But maybe warn users in the readme?

Anyway: thanks for this great tool :-)

@SamVerschueren
Copy link

You can still use 5.0.1 if you want. More information regarding this topic sindresorhus/ama#446 (comment).

@barbalex
Copy link
Author

barbalex commented Mar 13, 2017

Yep. Additionally it seems like create-react-app will soon change from uglify to babili so I don't have to indefinitely remain on an old version :-)

By the way, @SamVerschueren: Thanks a lot from reducing the burden from @sindresorhus and hopefully enabling him to remain crazy productive!

@SamVerschueren
Copy link

Thanks a lot from reducing the burden from @sindresorhus and hopefully enabling him to remain crazy productive!

Thanks, try to help wherever I can ;)

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