react-data-grid icon indicating copy to clipboard operation
react-data-grid copied to clipboard

ERROR in ./node_modules/react-data-grid/lib/bundle.js 100:16

Open msaiducar64 opened this issue 2 years ago • 9 comments

Describe the bug

ERROR in ./node_modules/react-data-grid/lib/bundle.js 100:16 Module parse failed: Unexpected token (100:16) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders | useLayoutEffect(() => { | if (!isSelected) return;

ref.current?.focus({

| preventScroll: true | }); Ekran Resmi 2022-05-31 16 41 35

To Reproduce

Link to code example:

Expected behavior

Environment

  • "react-data-grid": "^7.0.0-beta.13",
  • react/react-dom version: "^17.0.1" /"^17.0.1"

Additional context

msaiducar64 avatar May 31 '22 13:05 msaiducar64

Getting this error as well. To reproduce I simply installed the package into my CRA app and used the code from Quickstart sample.

Screen Shot 2022-06-09 at 12 13 43 PM
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-data-grid": "^7.0.0-beta.13",

"react-scripts": "4.0.3"

purplecones avatar Jun 09 '22 16:06 purplecones

Same issue as well. Really critical any help?

thegladysadjei avatar Jun 23 '22 18:06 thegladysadjei

Same issue as well. Really critical any help?

Install the previous version, it is only an issue with the latest.

vincaslt avatar Jun 24 '22 06:06 vincaslt

Was able to resolve it. It was an issue with javascript's optional chaining syntax ref.current?.focus({...}). In my case the issue happened when I tried running storybook. The storybook version we were using utilized webpack 4. Had to tell it to use webpack 5. In your .storybook/main.js add module.exports = { ... , typescript: { reactDocgen: false //if you're using typescript } core: { builder: 'webpack5' } };

Then had to install these in package.json @storybook/builder-webpack5 @storybook/manager-webpack5

If your issue is not with storybook, still try upgrading your webpack to webpack5

thegladysadjei avatar Jun 24 '22 13:06 thegladysadjei

It seems to be an issue with the bundling itself somehow as even old releases have this issue for me if I build them locally.

My guess is that probably some package has been upgraded, which somehow has broken the build process/output as well.

With this change it seems to work again and this specific issue is gone.

Screenshot 2022-07-01 at 10 21 13

ekeuus avatar Jul 01 '22 08:07 ekeuus

This issue happening new release as well, any solution to resolve this issue? image

"react": "^18.1.0", "react-data-grid": "^7.0.0-beta.14", "react-dom": "^18.1.0",

@vincaslt kindly share which previous version working?

rajasekar-mu avatar Aug 03 '22 19:08 rajasekar-mu

@vincaslt kindly share which previous version working?

I was able to get this working by downgrading to 7.0.0-beta.12.

+1 to fixing this on all versions greater than 7.0.0-beta.12

nstokoe avatar Aug 26 '22 18:08 nstokoe

I also hit the same issue while trying the latest versions, such as beta-19, and beta-20, does anybody understand what the root cause is? mind share your thoughts please if yes?

shawncao avatar Dec 04 '22 19:12 shawncao

It is probably the same issue for everyone, just post for reference, this suggestion worked for me - https://stackoverflow.com/questions/67543182/react-babel-you-may-need-an-additional-loader-to-handle-the-results-of-these

shawncao avatar Dec 04 '22 20:12 shawncao