core icon indicating copy to clipboard operation
core copied to clipboard

[enhanced] `tapable` is not a direct dependency

Open rrosenshain-sc opened this issue 10 months ago • 4 comments

Describe the bug

ModuleFederationPlugin is directly pulling tapable but it doesn't have a direct dependency on it. https://github.com/module-federation/core/blob/main/packages/enhanced/src/lib/container/runtime/FederationModulesPlugin.ts#L7

The plugin has a peer on Webpack, but due to how pnpm works it can't find it in my setup.

I tried making a PR but changeset wants to make it a major version which it shouldn't be so I gave up.

I'm using @module-federation/[email protected].

I think this is manifesting in my repo because I have a common build package which all apps are importing and there's some sort of collision of webpack versions due to how peers are treated with pnpm.

[webpackCompiler]: Webpack compiler encountered a fatal error. Error: Cannot find module 'tapable'
Require stack:
- node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]__e2dpczkafrj7mlrvqcekj4zbfq/node_modules/@module-federation/enhanced/dist/src/lib/container/runtime/FederationModulesPlugin.js
- node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]__e2dpczkafrj7mlrvqcekj4zbfq/node_modules/@module-federation/enhanced/dist/src/lib/container/runtime/EmbedFederationRuntimePlugin.js
- node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]__e2dpczkafrj7mlrvqcekj4zbfq/node_modules/@module-federation/enhanced/dist/src/lib/container/runtime/FederationRuntimePlugin.js
- node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]__e2dpczkafrj7mlrvqcekj4zbfq/node_modules/@module-federation/enhanced/dist/src/lib/sharing/ConsumeSharedPlugin.js
- node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]__e2dpczkafrj7mlrvqcekj4zbfq/node_modules/@module-federation/enhanced/dist/src/lib/sharing/SharePlugin.js
- node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]__e2dpczkafrj7mlrvqcekj4zbfq/node_modules/@module-federation/enhanced/dist/src/lib/container/ModuleFederationPlugin.js
- node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]__e2dpczkafrj7mlrvqcekj4zbfq/node_modules/@module-federation/enhanced/dist/src/wrapper/ModuleFederationPlugin.js
- node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]__e2dpczkafrj7mlrvqcekj4zbfq/node_modules/@module-federation/enhanced/dist/src/index.js
- shared/build/src/moduleFederation/generateMFPluginConfig.js
- client/compile/plugins.js
- client/compile/config/webpack.config.babel.js
- client/webpack.config.babel.js
- client/compile/compile.js

Reproduction

Will provide later if needed

Used Package Manager

pnpm

System Info

N/A

Validations

rrosenshain-sc avatar Jan 21 '25 18:01 rrosenshain-sc

can you install tappable on your end? does that resolve it?

ScriptedAlchemy avatar Jan 21 '25 18:01 ScriptedAlchemy

Stale issue message

github-actions[bot] avatar Mar 23 '25 15:03 github-actions[bot]

yea, I did that and issue resolved but would be nice if I didn't have to think about it. that library should be a dependency

rrosenshain-sc avatar Mar 26 '25 23:03 rrosenshain-sc

There's a pr open. I'll merge it

ScriptedAlchemy avatar Mar 26 '25 23:03 ScriptedAlchemy

Stale issue message

github-actions[bot] avatar May 26 '25 15:05 github-actions[bot]