Skip to content

Error: Failed to generate type declaration #4280

@shashwat-sagar

Description

@shashwat-sagar

Describe the bug

On creating the provider using "npm create module-federation@latest" and running it, i am getting type generation error.
start build started... ready built in 0.76 s start building src\bootstrap.tsx [ Module Federation DTS ] Error: Failed to generate type declaration. Execute the below cmd to reproduce and fix the error. #TYPE-001 args: {"cmd":"npx tsc --project 'F:\\project\\MAIN\\de\\node_modules\\.federation\\tsconfig.0b5131b1077ad173631933c628df35f4.json'"} View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/type/TYPE-001

on running the command:
npx tsc --project ...
or
npx tsc i get no typescript related errors errors.

The issue is only in creating the provider. I was facing this issue previously but i consumer too but after upgrading to "@module-federation/rsbuild-plugin":"^0.22.0" my issue solved but only on consumer module

Reproduction

[ Module Federation DTS ] Error: Failed to generate type declaration. Execute the below cmd to reproduce and fix the error. #TYPE-001 args: {"cmd":"npx tsc --project 'F:\project\MAIN\de\node_modules\.federation\tsconfig.0b5131b1077ad173631933c628df35f4.json'"} View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/type/TYPE-001

Used Package Manager

npm

System Info

System: Windows 11 machine
Node: v23.10.0
NPM: 11.0.0

package.json:
{
  "name": "de",
  "private": true,
  "version": "1.0.0",
  "scripts": {
    "dev": "rsbuild dev --open",
    "build": "rsbuild build",
    "preview": "rsbuild preview"
  },
  "dependencies": {
    "react": "^18.3.1",
    "react-dom": "^18.3.1"
  },
  "devDependencies": {
    "@rsbuild/core": "^1.2.15",
    "@rsbuild/plugin-react": "^1.1.1",
    "@types/react": "^18.3.11",
    "@types/react-dom": "~18.3.1",
    "typescript": "^5.7.2",
    "@module-federation/rsbuild-plugin":"^0.22.0"
  }
}

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions