fix: fatal error when current JS is not inside script tag#2229
fix: fatal error when current JS is not inside script tag#2229misak113 wants to merge 1 commit intowebpack:masterfrom
Conversation
* for example when html-webpack-inline-source-plugin is used, the JS is inlined in HTML in script tag. So in this case document.currentScript.getAttribute('src') is undefined
* undefined cannot be used as string with method replace. This cause a fatal error and crash app
|
Hi, I'm sorry for failing PR, but I added a special case to tests, where getCurrentScriptSource returns undefined. So it could be enough for test coverage. It's exactly the value, which would have been failing tests when my change is not applied. |
|
We need fix CI error |
Codecov Report
@@ Coverage Diff @@
## master #2229 +/- ##
=========================================
+ Coverage 93.89% 93.9% +<.01%
=========================================
Files 34 34
Lines 1278 1279 +1
Branches 366 367 +1
=========================================
+ Hits 1200 1201 +1
Misses 71 71
Partials 7 7
Continue to review full report at Codecov.
|
1 similar comment
Codecov Report
@@ Coverage Diff @@
## master #2229 +/- ##
=========================================
+ Coverage 93.89% 93.9% +<.01%
=========================================
Files 34 34
Lines 1278 1279 +1
Branches 366 367 +1
=========================================
+ Hits 1200 1201 +1
Misses 71 71
Partials 7 7
Continue to review full report at Codecov.
|
|
Closing in favor of #2246 |
For Bugs and Features; did you add new tests?
Motivation / Use-Case
Breaking Changes
Additional Info