From 6442155df004ba22fe7cb9734ae078b41ca781bc Mon Sep 17 00:00:00 2001 From: Kuitos Date: Mon, 18 Sep 2023 14:09:06 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9Doptimize=20FAQ=20(#2673)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .github/ISSUE_TEMPLATE/bug_report_cn.md | 3 ++- docs/faq/README.md | 13 +++++++------ docs/faq/README.zh.md | 7 +++++-- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 7bb1bb088..5dede1410 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -14,7 +14,7 @@ A clear and concise description of what the bug is. > Provide a mini GitHub repository which can reproduce the issue. - + ## How To Reproduce diff --git a/.github/ISSUE_TEMPLATE/bug_report_cn.md b/.github/ISSUE_TEMPLATE/bug_report_cn.md index adc82d063..9a4fc754f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report_cn.md +++ b/.github/ISSUE_TEMPLATE/bug_report_cn.md @@ -19,7 +19,8 @@ assignees: '' ## 最小可复现仓库 为节约大家的时间,无复现步骤的 ISSUE 会被关闭,提供之后再 REOPEN - + + ## 复现步骤,错误日志以及相关配置 diff --git a/docs/faq/README.md b/docs/faq/README.md index 1e4b43ab5..d160c8f31 100644 --- a/docs/faq/README.md +++ b/docs/faq/README.md @@ -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 diff --git a/docs/faq/README.zh.md b/docs/faq/README.zh.md index 0b684c8f3..879490322 100644 --- a/docs/faq/README.zh.md +++ b/docs/faq/README.zh.md @@ -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 是否有语法错误,比如少了分号、依赖了未初始化的变量等。