Git Product home page Git Product logo

Comments (6)

s-edupuganti avatar s-edupuganti commented on May 24, 2024 4

Hi @mbzzt,

Thanks for getting in touch.

Please use the following:

npm install react-app-rewired --save-dev

Create a file in the root of your project called config-overrides.js with the following contents:

module.exports = function override(config, env) {
    config.resolve.alias["react-dom/server"] = "react-dom/server.js";
    return config;
}

replace the following scripts in your package.json:

"react-scripts start" -> "react-scripts start"
"react-scripts build" -> "react-scripts build"

Kind regards, Zoheil

Hi @AG-Zoheil,

I didn't understand what we are supposed to replace in our package.json scripts section. I am encountering the same problem on 31.1.1, and 31.2. I have installed the react-app-rewired package, and have included the config override file.

Thanks.

EDIT: I realized they meant to write:

"react-scripts start" -> "react-app-rewired start"
"react-scripts build" -> "react-app-rewired build"

And since then my project has been finally able to build!

from ag-grid.

AG-Zoheil avatar AG-Zoheil commented on May 24, 2024 1

Hi @mbzzt,

Thanks for getting in touch.

Please use the following:

npm install react-app-rewired --save-dev

Create a file in the root of your project called config-overrides.js with the following contents:

module.exports = function override(config, env) {
    config.resolve.alias["react-dom/server"] = "react-dom/server.js";
    return config;
}

replace the following scripts in your package.json:

"react-scripts start" -> "react-scripts start"
"react-scripts build" -> "react-scripts build"

Kind regards,
Zoheil

from ag-grid.

seanlandsman avatar seanlandsman commented on May 24, 2024 1

This is only an issue for React 17 users that use CRA - non-CRA users or React 18+ users are unaffected.

This is an issue with how CRA consumes ESM modules.

This is a breaking change and should be documented as you say - this was an oversight on my part and documentation will be added shortly to highlight this change (and well as adding this to the changelog).

from ag-grid.

mbzzt avatar mbzzt commented on May 24, 2024

Thank you for your reply.
So this is the only way to use ag-grid along with Create React App going forward?
What was the change in 31.2.0 that caused this?
I could not find any mention of this in the change log nor in documentation. Can you please point me to any official documentation stating that overriding CRA config is the way to go for using ag-grid in a CRA-based application?
IMO, it's really hard to justify such config override just for upgrading ag-grid. And if there's really no other choice, please consider documenting this constraint, so everyone is aware about it.
Thanks.

from ag-grid.

mbzzt avatar mbzzt commented on May 24, 2024

Got it. Thank you for your reply.

from ag-grid.

efhan-the-unorthodox avatar efhan-the-unorthodox commented on May 24, 2024

Hi @mbzzt,

Thanks for getting in touch.

Please use the following:

npm install react-app-rewired --save-dev

Create a file in the root of your project called config-overrides.js with the following contents:

module.exports = function override(config, env) {
    config.resolve.alias["react-dom/server"] = "react-dom/server.js";
    return config;
}

replace the following scripts in your package.json:

"react-scripts start" -> "react-scripts start"
"react-scripts build" -> "react-scripts build"

Kind regards, Zoheil

I tried this. Didn't work.

The following are my dependencies:

"@ag-grid-community/client-side-row-model": "^31.2.1",
    "@ag-grid-community/core": "^31.2.1",
    "@ag-grid-community/react": "^31.2.1",
    "@ag-grid-community/styles": "^31.2.1",

from ag-grid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.