Our organization uses Zod in several micro-frontends that share resources via module federation. After recently updating Zod to the latest version in one of the micro-frontends I'm seeing this warning being emitted in the browser:
WARNING in shared module zod -> <path to my project>/.yarn/cache/zod-npm-3.25.56-a6f60427c3-f2faf9f9bf.zip/node_modules/zod/dist/esm/index.js No version specified and unable to automatically determine one. No version in description file (usually package.json). Add version to description file <path to my project>/.yarn/cache/zod-npm-3.25.56-a6f60427c3-f2faf9f9bf.zip/node_modules/zod/dist/esm/package.json, or manually specify version in shared config.
It appears that Module Federation is looking for a version field in the package.json located at zod/dist/esm/package.json, but that file only contains { "type": "module" }. As a result, the version can't be determined for sharing. It seems like this is maybe a side effect of the build changes for #4371.
I looked around at how the Zod packages are structured, and manually added a version field to that package.json locally, and the warning went away. I'm not sure if appending a version field during the build is the best long-term solution, but if that seems reasonable, I’d be happy to submit a PR to try and implement that.
Our organization uses Zod in several micro-frontends that share resources via module federation. After recently updating Zod to the latest version in one of the micro-frontends I'm seeing this warning being emitted in the browser:
WARNING in shared module zod -> <path to my project>/.yarn/cache/zod-npm-3.25.56-a6f60427c3-f2faf9f9bf.zip/node_modules/zod/dist/esm/index.js No version specified and unable to automatically determine one. No version in description file (usually package.json). Add version to description file <path to my project>/.yarn/cache/zod-npm-3.25.56-a6f60427c3-f2faf9f9bf.zip/node_modules/zod/dist/esm/package.json, or manually specify version in shared config.It appears that Module Federation is looking for a version field in the package.json located at
zod/dist/esm/package.json, but that file only contains{ "type": "module" }. As a result, the version can't be determined for sharing. It seems like this is maybe a side effect of the build changes for #4371.I looked around at how the Zod packages are structured, and manually added a version field to that package.json locally, and the warning went away. I'm not sure if appending a version field during the build is the best long-term solution, but if that seems reasonable, I’d be happy to submit a PR to try and implement that.