-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
lib client-api/src/client_api: check type of module.id as fileName #5909
lib client-api/src/client_api: check type of module.id as fileName #5909
Conversation
Great bug and thanks for the fix!! @ndelangen @tmeasday seems reasonable? |
Much further downwind when searching through file names, fuzzy-search and .includes requires that the fileName parameter is a string, not a number. This checks to make sure that the fileName is indeed a string, since webpack may sometimes return the module.id as a number. https://webpack.js.org/api/module-variables/#moduleid-commonjs
4c31a1e
to
bd4beca
Compare
@shilman i re-pushed to this branch after your approval since i noticed some failing test cases in the I changed the little ternary above to return An alternative would be to add |
Codecov Report
@@ Coverage Diff @@
## next #5909 +/- ##
=======================================
Coverage 34.97% 34.97%
=======================================
Files 648 648
Lines 9480 9480
Branches 1333 1360 +27
=======================================
Hits 3316 3316
Misses 5534 5534
Partials 630 630
Continue to review full report at Codecov.
|
…g-before-searching lib client-api/src/client_api: check type of module.id as fileName
Issue: #5907
What I did
Much further downwind when searching through file names,
fuzzy-search
and
.includes
requires thatparameters.fileName
is a string, and can't handle anumber. This checks to make sure that the fileName is indeed a string,
since webpack may sometimes return the module.id as a number.
https://webpack.js.org/api/module-variables/#moduleid-commonjs
How to test
mode = "production"