Skip to content

Adds declaration file to declare the remote module being imported

Henrique Franklim Bussolari requested to merge master into main

Justification: TypeScript not being aware of the module that is being dynamically imported using Vite Module Federation. This happens because TypeScript relies on type declarations to validate imports, and dynamic imports from remote modules typically don't have type declarations available at compile time. While the component works at runtime (since Module Federation loads it dynamically), TypeScript cannot resolve the module during type-checking, hence the error. Here’s how you can fix it:

Merge request reports