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
ResizeObserver Polyfill creates errors with Webpack & UglifyJS #29
Comments
Sorry about that 😞 Is there anything we can do to fix this? Or maybe it is an issue in the polyfill library? Thinking more about it and wondering what's causing this. I'm using UglifyJS for the demo build here https://github.com/souporserious/react-measure/blob/master/webpack.config.js#L37-L49 and it seems fine. Maybe I'm missing something. |
Might be because I'm using webpack 2 beta? |
Also getting a ResizeObserver error - Running Webpack 2:
|
Sorry, I'm not sure what is causing this 😞 I wish I could help. Please feel free to create a PR if you find a solution. |
I was able to get around this by not using |
This and #27 issues were caused by the I've also added a fallback for a non-browser environment which fixes the server rendering problem described in #24. These changes are available in v 1.3.1 and I believe that now you can remove all of those conditions. Guys, I'm really sorry about this mess. Why you didn't tell me about those problems in the first place? I would have fixed them long ago. |
I am trying to use react-measure@1.4.5 with react-boilerplate@3.3.3 and I am getting the following error when running the development server:
Is this error related to this issue? Sorry, I'm still new to React/Babel/Webpack2, but is there any additional information you need to help me solve this issue? |
@que-etc any idea on the above? |
Still tackling this problem but for now I found that v. 3.4.0 works fine. My take is that it has something to do with webpack@2.1.0-beta.25 which is used in the earlier version of react-boilerplate. Yeap, fixed in webpack@2.2.0-rc.0 (webpack/webpack#3168) |
@marcandrews would you please try updating to webpack 2.2? |
@que-etc @souporserious giving it a try now and will report back. Thanks. |
Updated to webpack@2.2.0-rc.3 and seems like everything is working. Thanks for the help! |
Thanks for the help @que-etc 🎉 |
Was running Webpack 2.1.0-beta.25. Updating to ^2.2.0 (2.2.1 at the time of writing) fixed my problem. |
New dev on the team tried to npm install our package.json and got the following error:
We had
react-measure: "^1.3.1"
inpackage.json
and the caret made it upgrade to1.4.x
when that was released.Looks like 1.4.x uses ResizeObserver polyfill which created the above error when webpack & uglifyjs are bundling. Technically you would be okay if you were to use uglifyjs harmony branch but since I don't want to fork webpack and subsequently modify the fork's package json, it's easier to just pin
react-measure
to 1.3.1 to solve this.Putting this here in case anyone else comes across it and something that you might want to think about since lotsa ppl use react with webpack and uglify in production.
The text was updated successfully, but these errors were encountered: