-
-
Notifications
You must be signed in to change notification settings - Fork 372
Closed
Labels
🐞 bugSomething isn't workingSomething isn't working
Description
Describe the bug
This example fails:
import { loadRemote, init } from '@module-federation/enhanced/runtime';
// init(...)
loadRemote<{add: (...args: Array<number>)=> number }>("app2/util").then((md)=>{
md.add(1,2,3);
});With error TS2558: Expected 0 type arguments, but got 1
Because global loadRemote implementation doesn't support generics:
https://github.com/module-federation/universe/blob/920d9869836dfe477e0139673ca3714248fb8827/packages/runtime/src/index.ts#L40
Reproduction
https://stackblitz.com/edit/vitejs-vite-ol6j9b?file=src%2Fmain.ts
Used Package Manager
npm
System Info
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 18.18.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.2.3 - /usr/local/bin/npm
pnpm: 8.15.3 - /usr/local/bin/pnpmValidations
- Read the docs.
- Read the common issues list.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Module federation issue and not a framework-specific issue.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
🐞 bugSomething isn't workingSomething isn't working