codesandbox / codesandbox-client

An online IDE for rapid web development
https://codesandbox.io
Other
12.96k stars 2.26k forks source link

Invalid left-hand side in assignment #8409

Closed andreifloricel closed 3 months ago

andreifloricel commented 3 months ago

🐛 bug report

Description of the problem

Getting an error: Invalid left-hand side in assignment. The root cause seems to be that this line from the stylis library: character = position > 0 ? charat(characters, --position) : 0 is transpiled as: exports.character = character = position > 0 ? (0, $csb___Utility_js.charat)(characters, --exports.position = position) : 0;

Link to sandbox: link

Similar previous issue: #4476

declan-warn commented 3 months ago

I'm getting the same error in this sandbox: https://codesandbox.io/p/sandbox/spring-frog-wd2rp7?file=%2Findex.js

I downloaded the sandbox and it is working locally. Tested using:

JonnyAdaptableTools commented 3 months ago

Same issue here, causing a blocker in our ability to release product updates

genepaul commented 3 months ago

Also getting the error in this sandbox

If you remove importing any external dependencies, it works. As soon as you import anything and use it, the error comes up. Completely blocking.

bogdanpetru commented 3 months ago

We are having the same issue. Thanks!

radubrehar commented 3 months ago

I get the same issue when using react-select - don't remember to have had this some while ago....

infinite-table-admin commented 3 months ago

Anyone has a solution to this? Thanks and appreciate all the hard work the team behind Codesandbox is putting into this. 🙌

devmentor-js commented 3 months ago

I get the same problem! The same code has no issue in StackBlitz...

roblotter commented 3 months ago

Same thing here - would appreciate a fix. Think it will affect other libraries out there as well.

radubrehar commented 3 months ago

thanks @CompuIves for the quick fix 🙌

Indeed this commit https://github.com/codesandbox/codesandbox-client/commit/35550d871cef8c62cb8288cc2cab73a8540075ed fixed the issue!

roblotter commented 3 months ago

waww... that was fast! awesome team at Codesandbox! ❤️ confirm all working now

CompuIves commented 3 months ago

It was a fun issue, a dependency started using this syntax and a lot of libraries use that dependency, haha. Happy to hear that it's fixed for everyone now 😄 .

andreifloricel commented 3 months ago

Thank you!