HAVE YOU ALREADY SEARCHED FOR SIMILAR ISSUES? PLEASE HELP US OUT AND DOUBLE-CHECK FIRST!
ALSO, PLEASE DON'T BE THAT PERSON WHO DELETES THIS TEMPLATE. IT'S HERE FOR A REASON.
THANKS!
WHICH VERSION OF REACT ARE YOU USING?
Officially Supported:
[ ] v0.14.x
Community Supported:
[x ] v15.0.x
WHICH BROWSER ARE YOU USING?
Officially Supported:
[ ] IE 9 / IE 10 / IE 11
[ ] Edge
[x ] Chrome
Should work:
[ ] Firefox
[ ] Safari
I'm submitting a ... (check one with "x")
[x ] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/adazzle/react-data-grid/blob/master/CONTRIBUTING.md
Current behavior
The react-data-grid-addons.js includes react's process.env.NODE_ENV checks.
Expected/desired behavior
These should not be included. When I include this library in my webpack build, I see a react warning "It looks like you're using a minified copy of the development build..."
Reproduction of the problem
If the current behavior is a bug or you can illustrate your feature request better with an example, please provide the steps to reproduce and if possible a minimal demo of the problem.
Download version of 2.0.15 of react-data-grid-addons, have a look in the react-data-grid-addons code, eg at lin 29482:
if (process.env.NODE_ENV !== 'production') {
...
What is the expected behavior?
As mentioned above, presumably these checks should have been replaced by the DefinePlugin in your webpack build. This code is not in react-data-grid.js
What is the motivation / use case for changing the behavior?
馃憤 Please do this! It would help a lot with dependency size and such.
Same bug for me
I have warning if I use react-data-grid-addons: "Warning: It looks like you're using a minified copy of the development build of React. When deploying React apps to production, make sure to use the production build which skips development warnings and is faster."
Same issue, any updates?
It looks like the problem is inherited from ron-react-autocomplete.
The PR malonecj/react-autocomplete#7 and re-bundling of both libraries should fix this.
I got this message too:
Warning: It looks like you're using a minified copy of the development build of React.
When deploying React apps to production,
make sure to use the production build which skips development warnings and is faster.
See https://fb.me/react-minification for more details.
And I isolated the problem down to process.env.NODE_ENV is undefined in react-data-grid-addon.js, Even though I set the env variable through webpack's DefinePlugin.
It is not undefined through out the entire file, just in this section:

I realized I can add test: /\.min\.js$/, as an option in UglifyJsPlugin to get rid of the error, but it does not register with React Dev Tools since it still thinks I am using the development version.
Is this coming along? and is there anything else I can do to fix my build while waiting for this?
@estermer If you want to fix your build really really hard (and probably by hand only), you can re-bundle react-data-grid using a re-bundled react-autocomplete using my PR malonecj/react-autocomplete#7.
I managed doing that in the past to check that it was really the source of the problem.
@madprog I am not sure what you did to re-bundle react-autocomplete using your PR. I have never done that before. could you help me with that? The reason is I didn't even think ron-react-autocomplete had anything to do with my problem considering when I install react-data-grid-addons it does not show ron-react-autocomplete in my node_modules.
@estermer You can use the following steps to re-bundle react-autocomplete using my PR:
git clone [email protected]:madprog/react-autocomplete.git -b fix-release-bundle
cd react-autocomplete
npm install
node_modules/.bin/gulp bundle --release
The compilation results can be found in lib/: reactAutoComplete.js and reactAutoComplete.min.js
You can then use these other steps to re-bundle react-data-grid-addons (where v2.0.2 is the tag or branch of the version you need; it may be master if you need the last patches):
cd ..
git clone [email protected]:adazzle/react-data-grid.git -b v2.0.2
cd react-data-grid
npm install
npm install ../react-autocomplete
cp ../react-autocomplete/lib/*.js node_modules/ron-react-autocomplete/lib
npm run build
Then in your project, you can copy the output files to your node_modules/react-data-grid* folders:
cd /path/to/your/project
rm -r node_modules/react-data-grid
cp -r /path/to/our/build/react-data-grid/packages/react-data-grid node_modules/
rm -r node_modules/react-data-grid-addons
cp -r /path/to/our/build/react-data-grid/packages/react-data-grid-addons node_modules/
You should get rid of the unwanted debug code:
# Before:
$ grep -l '"production"!==t\.env\.NODE_ENV' /workspace/project/node_modules/react-data-grid-addons/dist/react-data-grid-addons.min.js
/workspace/project/node_modules/react-data-grid-addons/dist/react-data-grid-addons.min.js
# After:
$ grep -l '"production"!==t\.env\.NODE_ENV' /workspace/project/node_modules/react-data-grid-addons/dist/react-data-grid-addons.min.js
zsh: exit 1 grep -l '"production"!==t\.env\.NODE_ENV'
I think you also need npm run beforepublish at the end of the second code block to rewrite the react-data-grid exports to their respective bundled outputs after building. Otherwise, the exports point to src instead of dist.
Awesome! this worked.
Only difference was I copied just the individual *.min.js and *.js files into their respective folder in my node modules. I did this because I was getting some webpack errors when I was building my package since there were some residual webpack lines in the full folder.
But awesome I got it to work with this. Thank you!
Did this make it to the main branch? We're seeing something similar in that our js bundle is huge because react-data-grid seems to be including a debug version of react, even in prod build?
I think it's dependent upon an upstream change (https://github.com/malonecj/react-autocomplete/pull/7), but the maintainer (@malonecj) appears MIA. Maybe somebody else could get that merged and published or even switch to a different fork of react-autocomplete if necessary?
CC @d4nj0nes @diogofcunha
We're encountering this too. Please fix!
same issue
Same issue here -- would like to know if a resolution is in sight.
Looks like [email protected] was just published with react and react-dom flagged as externals. If we could get that dependency version bumped here and published, it should resolve this issue.
Would be very nice!
Hi all. Have just published 2.0.56, so this will include [email protected] and not bundle React.js in compiled file
@malonecj I'm still seeing "ron-react-autocomplete": "^4.0.2" in package.json
Most helpful comment
Hi all. Have just published 2.0.56, so this will include
[email protected]and not bundle React.js in compiled file