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

Upgrading dependencies causes react-grid-layout Responsive to crash with babel-loader error #2035

Open
cristianghita24 opened this issue Apr 18, 2024 · 3 comments

Comments

@cristianghita24
Copy link

cristianghita24 commented Apr 18, 2024

Describe the bug

I've upgraded many dependencies in my project and react-grid-layout - WidthProvider(Responsive) started crashing my app.

this is the error

node_modules/react-grid-layout/build/utils.js 203:74
Module parse failed: Unexpected token (203:74)
File was processed with these loaders:
 * ../../node_modules/react-scripts/node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|  */
| function childrenEqual(a /*: ReactChildren*/, b /*: ReactChildren*/) /*: boolean*/{
>   return (0, _fastEquals.deepEqual)(_react.default.Children.map(a, c => c?.key), _react.default.Children.map(b, c => c?.key)) && (0, _fastEquals.deepEqual)(_react.default.Children.map(a, c => c?.props["data-grid"]), _react.default.Children.map(b, c => c?.props["data-grid"]));

The only "solution" I found online was setting browserslist in package.json but that didn't fix it.

I am using react-scripts + customize-cra to start the app. I don't plan on ejecting the application from cra. Is there some kind of babel plugin that has to be added and fixes everything? Really can't find a fix for this.

Your Example Website or App

www.codesandbox.io

Steps to Reproduce the Bug or Issue

  1. upgrade deps
  2. crash

Expected behavior

not crash

react-grid-layout library version

^1.4.4

Operating System Version

linux

Browser

Chrome

Additional context

No response

Screenshots or Videos

No response

@cristianghita24 cristianghita24 changed the title Upgrading dependencies causes react-grid-layout WidthProvider to crash with babel-loader error Upgrading dependencies causes react-grid-layout Responsive to crash with babel-loader error Apr 18, 2024
@dkireeti
Copy link

Duplicate of #2037

@dkireeti
Copy link

Hi @cristianghita24 , tried 1.4.2 ?

@cristianghita24
Copy link
Author

cristianghita24 commented Apr 24, 2024

Hi @cristianghita24 , tried 1.4.2 ?

Setting version to 1.4.2 fixed the issue. You have no idea how much time and stress you saved me, thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants