Skip to content
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

ESM package.json missing version results in error while using NX and ModuleFederation #239

Open
JSlonka opened this issue Aug 11, 2023 · 0 comments

Comments

@JSlonka
Copy link

JSlonka commented Aug 11, 2023

Hello,

we have started using axios-retry library in our project and immediately from start we have faced multiple issues caused by missing version in the ESM package.json folder.

All of the issues are related to the same missing version issue and all of them come from webpack from different places.

The first issue comes from module federation. Webpack is not able to determine the version properly because it is missing so it treats it as version 0, which results in the following error:

image

Temporary solution:
We were able to solve it by specifying the version directly in module federation config into the shared section.

image

The second issue comes from NX webpack, where it is also trying to determine the proper version of module used in a library.

It is just a warning about missing version but still we are trying to not have any of these warnings in production code.

image

Temporary solution:
We added the version specifically into the peerDeps of the library, which solved the issue.

Another one is again just a warning

image

We would like to ask you kindly if you could start putting the version into the package.json files in the cjs and esm folders to avoid these issues in the future, since the modifications required to the configuration by consumer are completely unnecessary.

We have tried manually adding the version into the package.json file and it did fix all issues

image

Thank you, with best regards,

Jakub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant