react-grid-layout / react-draggable

React draggable component
MIT License
9.04k stars 1.03k forks source link

Critical 4.4.6 Bug: Module parse failed: Unexpected token (78:10) #736

Open apwelsh opened 1 year ago

apwelsh commented 1 year ago

Using react-data-grid, which depends on react-resizable, which depends on react-draggable Since your update to 4.4.6, react-data-grid and react-sizable are now broken, and cannot be compiled into our projects.

Error reported is:

in ./node_modules/_react-draggable@4.4.6@react-draggable/build/cjs/Draggable.js Module parse failed: Unexpected token (78:10) You may need an appropriate loader to handle this file type. | y: position.y, | prevPropsPosition: { | ...position | } | };

There is another bug report on the same issue, but it it not receiving any attention, so I opened up another with specifics on my issue

micate commented 1 year ago

Version 4.4.6 introduced multiple ... syntaxes in the build results, which caused incompatibility issues with lower version browsers.

image

image

image

micate commented 1 year ago

Although browsers that do not support the ... syntax are too old, this change should be a major version upgrade rather than a minor version change.

apwelsh commented 1 year ago

This was under the latest build of chromium. It's not a browser issue. In fact, react builds use the node compiler to implement all the latest features on nearly every browser, so again, that isn't the issue. This is simply bad code that breaks core react components that rely on this code.