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

jsesc breaks uglifyjs? #2891

Closed
athomasoriginal opened this issue Aug 2, 2017 · 6 comments
Closed

jsesc breaks uglifyjs? #2891

athomasoriginal opened this issue Aug 2, 2017 · 6 comments

Comments

@athomasoriginal
Copy link

athomasoriginal commented Aug 2, 2017

Is this a bug report?

No.

Summary

I am experimenting with jsesc and I noticed that when used inside of react-create-app the yarn build command will fail saying there is an invalid assignment. You can see this behaviour in this demo repo:

https://github.com/tkjone/jsesc-test

You can see where I am using it in this file:

https://github.com/tkjone/jsesc-test/blob/master/src/App.js

To Reproduce

Move into the react-create-app demo provided above and run yarn build.

Output

➜ yarn build

yarn build v0.27.5
$ react-scripts build
Creating an optimized production build...
Failed to compile.

static/js/main.f43f915d.js from UglifyJs
Invalid assignment [./~/jsesc/jsesc.js:5,0][static/js/main.f43f915d.js:13460,32]

error Command failed with exit code 1.
@Timer
Copy link
Contributor

Timer commented Aug 3, 2017

Please post the output.

@athomasoriginal
Copy link
Author

@Timer, I have updated the original post with the output.

@Timer
Copy link
Contributor

Timer commented Aug 3, 2017

Please see npm run build fails to minify in our Troubleshooting seciton. 😄

Unfortunately, jsesc does not ship a browser-compatible version.

@Timer Timer closed this as completed Aug 3, 2017
@athomasoriginal
Copy link
Author

Yes, that would explain it. Thanks, @Timer

@mathiasbynens
Copy link

Unfortunately, jsesc does not ship a browser-compatible version.

It does: https://github.com/mathiasbynens/jsesc#support

@Timer
Copy link
Contributor

Timer commented Aug 3, 2017

@tkjone looks like you need to downgrade to version 1.x for browser support, per @mathiasbynens's comment.

@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants