-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Can't import the named export 'Component' from non EcmaScript module #6853
Comments
Some more context: using the latest version of ag-grid 30.0.3 with the [email protected].2 works, the problem is when upgrading the react wrapper to either 30.0.3 or 30.0.4 that the import problem shows. |
I am facing similar issues since we upgraded to ag-grid-react 30.0.3/30.0.4. If I pin it to 30.0.2, it all works fine.
Some details about my environment:
|
same issue here |
@mbzzt if you're able to provide a repo I'd be happy to see how we can assist you with this |
Sure. Repo: https://github.com/mbzzt/ag-grid-bug |
Thanks for the repo - I can see that this is an issue with react 17 (it works with react 18). If you can upgrade that will fix your problem otherwise I've a fix for this that will allow for backward compatability. Our next release is scheduled for next week - the fix for this will be included in that release. For clarity: the fix for "Module not found: Error: Can't resolve 'react-dom/server' " will be included thanks |
What about the original reported problem by me? Will this also be fixed? We are also still using react 17 ./node_modules/ag-grid-react/lib/agGridReact.mjs |
If you provide a repo I'll be happy to take a look - as it stands I'm afraid there's not really enough information to go on |
@seanlandsman awesome, thanks a lot for your prompt response! |
Sure, I have forked @mbzzt repo (many thanks @mbzzt) and adapted to repro my case: https://github.com/fitterfizzle/ag-grid-bug Edit: notable change is that we are still at react-scripts 4.0.3 instead of 5.0.1 and we can't upgrade at the moment |
Any news based on my last comment @seanlandsman ? |
I'll be providing a fuller answer soon but unfortunately this looks like something that will require react-scripts 5.x and either a "patch" to react-dom or ejecting the project and making a webpack configuration change. This is an issue with react (fixed in 18 but not backported) - I've spent some time trying to see if I could change things to prevent the need for the above but I'm afraid I can't. The "fix" is either:
(adding
Unfortunately both of these changes will require react-scripts 5.x |
But this means that starting with v30.0.3 ag-grid is effectively dropping support for react-scripts 4.x :/ |
We have just released 30.0.6 : please see ES Modules & CommonJS for more information |
I had this error when I try to imported AgReactGrid and how can i fix it |
error |
Same for me, "react": "^18.3.1", "react-app-rewired": "^2.2.1". Ag Grid - 32.0.2 |
I'm submitting a ... (check one with "x")
Customers of AG Grid
If you are a customer you are entitled to use the AG Grid's customer support system (powered by Zendesk). Please use that channel for guaranteed response from the AG Grid team with regards bugs, feature requests and support.
Requesting Community Support
If you are not a customer of AG Grid, ag-grid staff will label your issue as managed-by-the-community. This means that AG Grid staff is not going to be actively looking into it and it will get closed if inactive for more than one month. The community is welcome to help with this question/support issue.
Providing a Reproducible Scenario
After updating to the latest ag-grid community version and the react wrapper and doing a clean npm i both npm run and npm build fail with the below mentioned error message.
Neither starting local development nor building the CRA app is possible anymore. This has worked flawlessly before upgrading.
Accepted reproducible scenarios are
If you decide to send us a plunker, from any example in our website use the plunker button in there to fork your own code by following the steps below:
If reporting a bug make sure to state.
Current behaviour.
Expected behaviour. If possible back this up with our docs/examples if possible
Current behavior
Expected behavior
npm run start
ornpm run build
should workPlease tell us about your environment:
MacOS
"ag-grid-community": "^30.0.3",
"ag-grid-react": "^30.0.4",
Chrome
All
The text was updated successfully, but these errors were encountered: