softonic / axios-retry

Axios plugin that intercepts failed requests and retries them whenever possible
Other
1.9k stars 167 forks source link

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

Open JSlonka opened 1 year ago

JSlonka commented 1 year ago

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.

1. 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

2. 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.

3. 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