Skip to content

Commit

Permalink
📝optimize FAQ (#2673)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuitos authored Sep 18, 2023
1 parent bcaa505 commit 6442155
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A clear and concise description of what the bug is.

> Provide a mini GitHub repository which can reproduce the issue.
<!-- https://github.com/YOUR_REPOSITORY_URL -->
<!-- YOUR_REPOSITORY_URL -->

## How To Reproduce

Expand Down
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ assignees: ''
## 最小可复现仓库

为节约大家的时间,无复现步骤的 ISSUE 会被关闭,提供之后再 REOPEN
<!-- https://github.com/YOUR_REPOSITORY_URL -->

<!-- 你的仓库链接 -->

## 复现步骤,错误日志以及相关配置

Expand Down
13 changes: 7 additions & 6 deletions docs/faq/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,16 @@ If it still reports an error, check whether the container DOM is placed on a rou

## `[import-html-entry]: error occurs while excuting xxx script http://xxx.xxx.xxx/x.js`
![](https://user-images.githubusercontent.com/22413530/109919189-41563d00-7cf3-11eb-8328-711228389d63.png)
The first line is just an auxiliary information printed by qiankun through console.error, which is used to help users quickly know which js has an error, not a real exception. The real exception information is on the second line.
The first line is just a helper info printed by qiankun via `console.error` to help users identify which js file threw the error faster. It is not an exception thrown by qiankun itself.

For example, such an error indicates that when qiankun was executing the http://localhost:9100/index.bundle.js of the sub application, this js itself threw an exception. The specific exception information is Uncaught TypeError: Cannot read property 'call' of undefined.
**The actual exception info is in the second line.**

Sub-application exceptions can be attempted to be resolved through the following steps:
For example in the error above, it means the child app itself threw an exception when executing http://localhost:9100/index.bundle.js. **And the actual exception message is `Uncaught TypeError: Cannot read property 'call' of undefined` in the second line.**

Check the error js for syntax errors according to the specific exception information, such as missing semicolons, dependence on uninitialized variables, etc.
Whether it depends on global variables provided by the main application, but the main application is not actually initialized.
Compatibility issues. The js itself of the sub-application has syntax compatibility issues in the current runtime environment.
Exceptions from the child app itself can be debugged and fixed with the following steps:
1. Based on the specific exception message, check if the js file that errors has syntax errors, like missing semicolons, depending on uninitialized variables etc.
2. Whether it depends on global variables provided by the main app, but the main app did not initialize them.
3. Compatibility issues. The child app js itself has syntax compatibility issues in the current runtime environment.

## How to load micro apps on a routing page of the main app

Expand Down
7 changes: 5 additions & 2 deletions docs/faq/README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,12 @@ qiankun 抛出这个错误是因为微应用加载后容器 DOM 节点不存在

## `[import-html-entry]: error occurs while excuting xxx script http://xxx.xxx.xxx/x.js`
![](https://user-images.githubusercontent.com/22413530/109919189-41563d00-7cf3-11eb-8328-711228389d63.png)
其中第一行只是 qiankun 通过 `console.error` 打印出来的一个辅助信息,目的是帮助用户更快的知道是哪个 js 报错了,并不是真的异常。真正的异常信息在第二行。

比如上图这样一个报错,指的是 qiankun 在执行子应用的 `http://localhost:9100/index.bundle.js` 时,这个 js 本身抛异常了。而具体的异常信息就是 `Uncaught TypeError: Cannot read property 'call' of undefined`.
其中第一行只是 qiankun 通过 `console.error` 打印出来的一个辅助信息,目的是帮助用户更快的知道是哪个 js 报错了,并不是 qiankun 本身发生了异常。

**真正的异常信息在第二行。**

比如上图这样一个报错,指的是子应用在执行 `http://localhost:9100/index.bundle.js` 时,这个 js 本身抛异常了。**而具体的异常信息就是第二行的 `Uncaught TypeError: Cannot read property 'call' of undefined`**

子应用本身的异常,可以尝试通过以下步骤排查解决:
1. 根据具体的异常信息,检查报错的 js 是否有语法错误,比如少了分号、依赖了未初始化的变量等。
Expand Down

1 comment on commit 6442155

@vercel
Copy link

@vercel vercel bot commented on 6442155 Sep 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.