Skip to content
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

require 模块失败后,再次 require 该模块不会重新加载 #78

Open
ghost opened this issue Apr 25, 2018 · 0 comments
Open

require 模块失败后,再次 require 该模块不会重新加载 #78

ghost opened this issue Apr 25, 2018 · 0 comments

Comments

@ghost
Copy link

ghost commented Apr 25, 2018

问题描述:esl 环境中,在断网的情况下 require 模块失败,在连网后再次触发 require 该模块 不会触发该模块的加载。

通过阅读esl源码,个人认为问题原因为:无论模块加载成功与否,loadingModules[moduleId1] 都会赋值为 1,导致即使后来再次 require([moduleId1]) 也不会进入到新建 script 加载的逻辑。
b3342b8d4424eeb44a9866869

建议: 在此挂接 onerror 的错误处理,重新赋值 loadingModules[moduleId1] 为 0,使得加载某个模块失败后,还能重新加载该模块。
6efd7efdb7ff3ea797adcf437

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants