module-federation-examples icon indicating copy to clipboard operation
module-federation-examples copied to clipboard

Build on build server without @mf-types in repository

Open lestersconyers opened this issue 10 months ago • 1 comments

Hello. I have a project that has a shell app (host app) and 5 remote apps using MF 2.0. Currently when we run pnpm run dev everything works as expected including the type checking. We currently have @mf-types in our gitignore file so mf-types directory is not in the repository.

When we attempt to build the host app on remote build server (Azure DevOps) the builds fail because mf-types does not exist so the types do not exist.

error TS2307: Cannot find module 'remoteApp1/components/myComponent' or its corresponding type declarations.

How do I go about building with typescript on a build server?

lestersconyers avatar Feb 04 '25 23:02 lestersconyers

ts-ignore or commit the types dir

ScriptedAlchemy avatar Mar 20 '25 01:03 ScriptedAlchemy