I'm in the process of upgrading from babel 6 to babel 7. Some of my old tests using chai, sinon, and enzyme come up with the following error:
TypeError: Cannot assign to read only property 'exports' of object '#<Object>'
I do have some code that is using "require" instead of "export" and I know that the babel 7 documentation says that you might need to use "require().default" instead. But that doesn't seem to be helping.(Or I just need to finish putting defaults everywhere and calling them before any the errors will go away). Does anyone else have experience with this issue?
Try not to mix require / module.exports
and import / export
, ensure to be consistent with one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With