-
-
Notifications
You must be signed in to change notification settings - Fork 851
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
Cannot import from immer with webpack 4 #333
Comments
Related: #331 (comment) However I can't reproduce this using CRA and the example code. |
Fun fact: there is not a single 'require' (or import for that matter)
statement in 'immer.mjs'....
Make sure to at least upgrade webpack to the latest version of 4, as there
has been some bugs with this in the past, for example:
webpack/webpack#8491
…On Wed, Mar 13, 2019 at 10:55 AM EGOIST ***@***.***> wrote:
Related: #331 (comment)
<#331 (comment)>
However I can't reproduce this using CRA and the example code
<https://github.com/mweststrate/immer#example>.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#333 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABvGhMUkcIYSiqzW_x1t5Hkvm3ifEhLiks5vWMsugaJpZM4bsyWv>
.
|
Thanks for the lightning fast response guys! I'll keep you posted |
CRA works because of above config so, for me, #331 (comment) |
Since it seems fixed with 2.1.3, I think we can close this issue? Could you confirm @erango? |
Yes 😄 Thanks everyone! |
🐛 Bug Report
When importing immer to React with Webpack 4, I get this exception:
Error was not caught ReferenceError: require is not defined at Module.../node_modules/immer/dist/immer.mjs (immer.mjs:1066)
To Reproduce
Use a react + webpack 4 setup, such as the default create-react-app setup.
Expected behavior
Import should work.
Environment
setUseProxies(true)
setUseProxies(false)
(ES5 only)The text was updated successfully, but these errors were encountered: