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 PageBUILD-002
Next PageTYPE-001

#Overview

Type errors are divided into two types: fixed error code errors and scenario-related errors.

#Fixed error code errors

This type of error can be clearly captured in the code, and a fixed error code is assigned to each error. The error code consists of the error type and ID, such as TYPE-001. You can find the specified page based on the error code to understand the cause of the error and the solution.

#Error code list

  • TYPE-001

#Scenario-related errors

This type of error is generated based on the user's specific scenario and has no fixed error code. The error message and handling method will vary depending on the scenario.

#Generated type contains aliases

Phenomenon description

The type generated by the producer contains aliases and cannot be processed normally in the consumer.

How ​​to solve

  1. Install typescript-transform-paths and ts-patch

  2. Apply typescript-transform-paths in tsconfig.json

{
"compilerOptions": {
+ "plugins": [
+ { "transform": "typescript-transform-paths" },
+ {
+ "transform": "typescript-transform-paths",
+ "afterDeclarations": true
+ }
+ ],
},
}
  1. Set dts.generateTypes.compilerInstance to tspc(ts-patch cli)
  2. Regenerate types

#Generated types not updating when working behind a local proxy

Phenomenon description

The types generated by the producer are successfully generated, the consumer log shows that the types are successfully processed, but the @mf-types directory does not update. The issue can be a proxy configuration problem not allowing the resource to be downloaded.

How ​​to solve

  1. Check if the @mf-types directory is generated in the dist directory of the producer.
  2. Check your proxy log for any errors related to TLS or SSL.
  3. Adapt your proxy configuration to add TLS certification for your local environment.
  4. In some scenarios this is not working. An alternative is, to define the environment variable NODE_TLS_REJECT_UNAUTHORIZED=0 to ignore the TLS or SSL errors. This will allow the @mf-types.zip to be properly handled.
Important note

Only set NODE_TLS_REJECT_UNAUTHORIZED=0 in your local development environment. It is not meant for production use. If you go this route, please make sure to commit the generated types to your repository.