question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

jsesc breaks uglifyjs?

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Timercommented, Aug 3, 2017

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

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

0reactions
Timercommented, Aug 3, 2017

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to preserve line breaks in UglifyJS? - Stack Overflow
Well, you can always pass the -b option to UglifyJS (read here). This preserves the line breaks and indentation of the file.
Read more >
Diff - platform/external/chromium-trace - Google Git
... + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", ... wasSuccessful(): - ok = False - if options.stop_on_error: - break - if ok ...
Read more >
Help-widget NPM | npm.io
This is a template for adding a generic intercom-like help widget to your site. Check out the demo. Develop. yarn; yarn start. Use....
Read more >
Dependencies | @backstage/cli | npm - Open Source Insights
arrow_right @babel/core. 7.20.5 Notes Version 7.20.5 Published November 28... arrow_right @babel/plugin‑transform‑modules‑commonjs. 7.19.6 Notes Version 7.19.6 Published October 20, 20...
Read more >
Build a Pluggable Web Widget: Getting Error - Mendix Forum
... 574 silly pacote range manifest for jsesc@^1.3.0 fetched in 359ms ... https://registry.npmjs.org/uglify-js 179ms (from cache) 586 silly ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found