Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Federation Runtime API types not working as expected for loadRemote #2921

Open
5 tasks done
pganster opened this issue Sep 4, 2024 · 5 comments
Open
5 tasks done

Comments

@pganster
Copy link

pganster commented Sep 4, 2024

Describe the bug

According to the module federation guide, loadRemote should return the inferred types for the supplied remote, but it doesn't. The returned promise always resolve an unknown.

Reproduction

https://github.com/pganster/module-federation-runtime-api-type-prompts

Used Package Manager

yarn

System Info

System:
    OS: Linux 6.10 Arch Linux
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i9-11900H @ 2.50GHz
    Memory: 34.43 GB / 62.53 GB
    Container: Yes
    Shell: 5.2.32 - /bin/bash
  Binaries:
    Node: 18.16.1 - ~/.nvm/versions/node/v18.16.1/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v18.16.1/bin/yarn
    npm: 9.5.1 - ~/.nvm/versions/node/v18.16.1/bin/npm
    pnpm: 8.9.2 - ~/.nvm/versions/node/v18.16.1/bin/pnpm

Validations

@pganster
Copy link
Author

pganster commented Oct 3, 2024

Any opinions @ScriptedAlchemy or is this a known issue?

@ScriptedAlchemy
Copy link
Member

ScriptedAlchemy commented Oct 6, 2024

I'll raise to my team. Will pull it Monday and see if it notice any specific errors.

@ScriptedAlchemy
Copy link
Member

@2heal1 can you take a look?

@2heal1
Copy link
Member

2heal1 commented Nov 6, 2024

Sorry for replying latter , if you want to use API types , you need to add ./@mf-types/* to you tsconfig.json include option ,like this

{
  "compilerOptions": {
    "target": "ES2020",
    "lib": ["DOM", "ES2020"],
    "module": "ESNext",
    "noEmit": true,
    "strict": true,
    "skipLibCheck": true,
    "isolatedModules": true,
    "resolveJsonModule": true,
    "moduleResolution": "node",
    "useDefineForClassFields": true,
    "allowImportingTsExtensions": true,
    "paths":{
      "*": ["./@mf-types/*"]
    }
  },
+ "include": ["src","./@mf-types/*"]
}

@2heal1
Copy link
Member

2heal1 commented Nov 6, 2024

I will add it to our docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants