Yes
Yes
Dynamic import
CRA v2.0.0
After updating react-scripts to v2 I can see an error Unhandled Rejection (TypeError): throttle is not a function.
In my code I do a dynamic import of lodash throttle. I created a codesandbox to reproduce what I do: https://codesandbox.io/s/4jp4j3l360 if you test with the deployed version you will notice in the console that an object is returned: https://csb-4jp4j3l360-jfpilaxokx.now.sh/
The dynamic import should return a function isntead of an object.
Wait, I think this is expected. You have to import('').default, I believe.
Yes, see https://medium.com/webpack/webpack-4-import-and-commonjs-d619d626b655. We should document this as breaking behavior and provide migration instructions.
Thank you for your answer, your solution works.
We will add this to the breaking migration instructions.
Documented in the migration instructions.
Most helpful comment
Yes, see https://medium.com/webpack/webpack-4-import-and-commonjs-d619d626b655. We should document this as breaking behavior and provide migration instructions.