You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using modern.js with module federation and host's tsconfig sets moduleResolution as bunder, @modern-js/runtime/mf could not be correctly resolved by typescript server.
To reproduce:
Open the reproduction in an editor and install packages
Open file modernjs-ssr/host/src/components/dynamic-remote.tsx
File modernjs-ssr/tsconfig.json has overiden the moduleResolution as Bundler, then node_modules/@module-federation/modern-js/types.d.ts is no longer loaded by the tsserver, so package @modern-js/runtime/mf is only resolved to @modern-js/runtime/* (provided by node_modules/@modern-js/app-tools/lib/types.d.ts) and all the symbols provided by @module-federation/modern-js cannot be resolved.
Workaround: instead of import from @modern-js/runtime/mf, import from @module-federation/modern-js/runtime
Documents of module federation suggests @modern-js/runtime/mf, but I don't know why you would prefer such a package alias instead of simply @module-federation/modern-js/runtime.
Not sure if the issue is easy to fix.
Describe the bug
When using modern.js with module federation and host's tsconfig sets moduleResolution as bunder,
@modern-js/runtime/mf
could not be correctly resolved by typescript server.To reproduce:
Open the reproduction in an editor and install packages
Open file
modernjs-ssr/host/src/components/dynamic-remote.tsx
Diff of the reproduction:
module-federation/module-federation-examples@81b3fde
File
modernjs-ssr/tsconfig.json
has overiden the moduleResolution asBundler
, thennode_modules/@module-federation/modern-js/types.d.ts
is no longer loaded by the tsserver, so package@modern-js/runtime/mf
is only resolved to@modern-js/runtime/*
(provided bynode_modules/@modern-js/app-tools/lib/types.d.ts
) and all the symbols provided by@module-federation/modern-js
cannot be resolved.Is there any workaround for this?
Reproduction
https://github.com/yf-yang/module-federation-examples/tree/modernjs-bug
Used Package Manager
pnpm
System Info
Validations
The text was updated successfully, but these errors were encountered: