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.

"ReferenceError: Invalid left-hand side expression in postfix operation" in production build

See original GitHub issue

Update: if you see this, you have a buggy version of UglifyJS (2.8.0).

Run rm -rf node_modules and then npm install (or yarn).

Then verify that node_modules/uglify-js/package.json has at least 2.8.1 in the version field. If not, you might need to clean your cache, or update your lockfile or shrinkwrap.

Original Post

I see this both in Windows and OS X tests.

  Integration
    Environment variables
Error: Uncaught [ReferenceError: Invalid left-hand side expression in postfix operation]
    at reportException (/tmp/tmp.sLfC3ipnAc/test-kitchensink/node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js:58:24)
    at processJavaScript (/tmp/tmp.sLfC3ipnAc/test-kitchensink/node_modules/jsdom/lib/jsdom/living/nodes/HTMLScriptElement-impl.js:130:7)
    at HTMLScriptElementImpl._eval (/tmp/tmp.sLfC3ipnAc/test-kitchensink/node_modules/jsdom/lib/jsdom/living/nodes/HTMLScriptElement-impl.js:65:7)
    at /tmp/tmp.sLfC3ipnAc/test-kitchensink/node_modules/jsdom/lib/jsdom/browser/resource-loader.js:31:22
    at Object.check (/tmp/tmp.sLfC3ipnAc/test-kitchensink/node_modules/jsdom/lib/jsdom/living/nodes/Document-impl.js:85:11)
    at ResourceQueue.resume (/tmp/tmp.sLfC3ipnAc/test-kitchensink/node_modules/jsdom/lib/jsdom/living/nodes/Document-impl.js:119:12)
    at DocumentImpl.close (/tmp/tmp.sLfC3ipnAc/test-kitchensink/node_modules/jsdom/lib/jsdom/living/nodes/Document-impl.js:518:17)
    at Document.close (/tmp/tmp.sLfC3ipnAc/test-kitchensink/node_modules/jsdom/lib/jsdom/living/generated/Document.js:322:27)
    at _callee$ (/tmp/tmp.sLfC3ipnAc/test-kitchensink/integration/initDOM.js:55:7)
    at tryCatch (/home/travis/build/facebookincubator/create-react-app/packages/babel-preset-react-app/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:64:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/home/travis/build/facebookincubator/create-react-app/packages/babel-preset-react-app/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:299:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/home/travis/build/facebookincubator/create-react-app/packages/babel-preset-react-app/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:116:21)
    at step (/tmp/tmp.sLfC3ipnAc/test-kitchensink/integration/initDOM.js:13:191)
    at /tmp/tmp.sLfC3ipnAc/test-kitchensink/integration/initDOM.js:13:361
    at run (/tmp/tmp.sLfC3ipnAc/test-kitchensink/node_modules/babel-polyfill/node_modules/core-js/modules/es6.promise.js:87:22)
    at /tmp/tmp.sLfC3ipnAc/test-kitchensink/node_modules/babel-polyfill/node_modules/core-js/modules/es6.promise.js:100:28
    at flush (/tmp/tmp.sLfC3ipnAc/test-kitchensink/node_modules/babel-polyfill/node_modules/core-js/modules/_microtask.js:18:9)
    at nextTickCallbackWith0Args (node.js:489:9)
    at process._tickCallback (node.js:418:13) [ReferenceError: Invalid left-hand side expression in postfix operation]

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
gaearoncommented, Feb 28, 2017

OK, I think we don’t need to fix it on our end because Uglify will push out a fix soon. https://github.com/mishoo/UglifyJS2/issues/1516#issuecomment-283085402

1reaction
Timercommented, Feb 28, 2017

I would be interested to know if the 0.9.x branch still builds. Just fired off a rebuild on 0.9.x/HEAD: https://travis-ci.org/facebookincubator/create-react-app/builds/205512060

Read more comments on GitHub >

github_iconTop Results From Across the Web

JS Invalid left-hand side expression in postfix operation?
This error is in reference to a ++ or -- following a non reference, such as a returned value. The problem is somewhere...
Read more >
ReferenceError: Invalid left-hand side ... - Codecademy
var newArray = []; // Here I filled the spots in the newArray with 0s so we can // count their occurances in...
Read more >
ReferenceError: Invalid left-hand side expression in ... - SitePoint
Hi, Following is my code i.e., tool3.js var assert = require('assert'); const path = require("path"); const fs = require("fs"); ...
Read more >
Invalid left-hand side expression in postfix operation (Example)
Following along, went to see how my code worked and I get the error "Invalid left-hand side expression in postfix operation".
Read more >
Invalid Left-Hand Side Expression In Prefix Operation - ADocLib
ReferenceError: Invalid lefthand side expression in postfix operation in production build #1681. Closed. gaearon opened this issue on Feb.
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