logologo
Guide
Practice
Configuration
Plugins
Showcase
Blog
Ecosystem
Module Federation Examples
Practical Module Federation
Zephyr Cloud
Nx
简体中文
English
Guide
Practice
Configuration
Plugins
Showcase
Blog
Module Federation Examples
Practical Module Federation
Zephyr Cloud
Nx
简体中文
English
logologo

Getting Started

Introduction
Setting Up the Environment
Quick Start Guide
Feature Navigation
Glossary of Terms
npm Packages

basic

Runtime

Runtime Access
Runtime API
Runtime Hooks
Rsbuild Plugin
Rspack Plugin
Webpack Plugin
Rspress Plugin
Vite Plugin
Metro
Type Hinting
Command Line Tool
Style Isolation

Data Solution

Data Fetching
Data Caching
Prefetch

Frameworks

Modern.js
Next.js

Deployment

Deploy with Zephyr Cloud

Debug

Enable debug mode
Chrome DevTools
Global variables

Troubleshooting

Overview

Runtime

RUNTIME-001
RUNTIME-002
RUNTIME-003
RUNTIME-004
RUNTIME-005
RUNTIME-006
RUNTIME-007
RUNTIME-008
RUNTIME-009

Build

BUILD-001
BUILD-002

Type

Overview
TYPE-001
Other
Edit this page on GitHub
Previous PageOverview
Next PageOther

Failed to generate type declaration. Execute the below cmd to reproduce and fix the error.

  • Error Code: TYPE-001

#Reasons

When compiling the exported (exposes) file TS type, the current project's tsconfig.json will be used. If the configuration file is missing some properties, the build type will fail.

#Solutions

  1. Delete the tsconfig.json incremental and tsBuildInfoFile configurations in the cmd command.
  2. Execute the cmd command in the error message parameter in the terminal, and repair the file or tsconfig according to the error message.

If you want to ignore the type check error in ts, you can set compilerOptions.noCheck to true in tsconfig.json (This option is only supported for ts 5.5 and above)

If the cmd command is executed without an error, but the error TS compilation fails is still reported, you need to check the exposes field in ModuleFederationPlugin:

[modern|rspack|rsbuild|webpack].config.[js,ts]
new ModuleFederationPlugin({
    ...
    // Make sure all keys start with "./"
    exposes: { './Foo': './src/<path-to-file>/Foo.tsx' },
    ...
  })