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

Webpack can't find version from nested package.json when using federated modules #308

Open
Jet004 opened this issue Dec 10, 2024 · 1 comment

Comments

@Jet004
Copy link

Jet004 commented Dec 10, 2024

date-fns-tz (ESM) currently displays the below warning when being used with Webpack federated modules for micro-frontend architectures and requires a workaround which can hide some important Webpack warnings.

WARNING in shared module date-fns-tz
No version specified and unable to automatically determine one. No version in description file (usually package.json). Add version to description file node_modules\date-fns-tz\dist\esm\package.json, or manually specify version in shared config.

In projects implementing federated modules Webpack requires the version to be present in nested package.json files. This allows Webpack to correctly resolve dependencies.

Webpack and NPM both determine that name and version should be required in all package.json files published publicly, including nested package.json files. See related issues below.

Related issue in Webpack: Issue 13457
Related discussion in NPM documentation: PR 134

I tested adding the name and version to package.json and the error was resolved.

Can we add this small change to enable users of federated modules, please? I am happy to add a PR for this.

@marnusw
Copy link
Owner

marnusw commented Dec 10, 2024

Yes, please create a PR @Jet004. Thank you.

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

2 participants