Skip to content

docs: add debug part #3739

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

Merged
merged 1 commit into from
Apr 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apps/website-new/docs/en/guide/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
"name": "framework",
"label": "Frameworks"
},
{
"type": "dir",
"name": "debug",
"label": "Debug"
},
{
"type":"dir",
"name":"troubleshooting",
Expand Down
2 changes: 1 addition & 1 deletion apps/website-new/docs/en/guide/basic/_meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["runtime", "rsbuild", "rspack", "webpack", "vite", "chrome-devtool", "type-prompt","cli"]
["runtime", "rsbuild", "rspack", "webpack", "vite", "type-prompt","cli"]
1 change: 1 addition & 0 deletions apps/website-new/docs/en/guide/debug/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[ "mode","chrome-devtool","variables"]
25 changes: 25 additions & 0 deletions apps/website-new/docs/en/guide/debug/mode.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Enable debug mode

To facilitate troubleshooting, Module Federation provides a debug mode. You can add the FEDERATION_DEBUG=true environment variable when executing a build or execute `localStorage.setItem('FEDERATION_DEBUG','true')` in the browser to enable the debug mode of Module Federation.

Build and add environment variables:

```bash
# Debug development mode
FEDERATION_DEBUG=true pnpm dev

# Debug production mode
FEDERATION_DEBUG=true pnpm build
```

Runtime and add environment variables:

```
localStorage.setItem('FEDERATION_DEBUG','true')
```

## Log information

After enabling debug mode, you can see the following information in the console:

In debug mode, you will see some logs starting with `[ Module Federation ]` output in the terminal.
Loading