Attempted import error: 'default' is not exported from '../assertThisInitialized/_index.mjs' - webpack incorrectly imports named imports as default

Viewed 158

For some strange reason, Webpack incorrectly attempts to import named imports as default. I noticed the problem when I tried to build my project in a docker container. I got the following error: enter image description here

I also tried building the project directly on my mac and it was initially built successfully. But after deleting my node_modules folder and running npm install afresh, my project stopped compiling. It started to throw the same error:

enter image description here

My package.json file didn't change in any way and all my packages have fixed (exact) versions. I've tried updating babel and all its plugins and even tried to build the last commit that successfully built two weeks ago but all to no avail.

I still can't understand why my project won't compile anymore if absolutely nothing changed. Did something change on the npm registry?

Is anyone else experiencing a similar problem? Any ideas on how to solve it?

0 Answers
Related