-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
bug: fix the param 'file' might be undefined #11160
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Can you provide a boiled down reproduction of the problem? |
Coding a test case could help understand the issue as well |
https://github.com/LoveofRedMoon/vue-ts-ssr-demo.git
when i run 'npm run build:win' (actually file `vue-ssr-client-manifest.json => modules => any` contains -1)
then 'ts-node serve/serve.ts', the serve starts.
when visit any web (ex: localhost:8000), it will shows error 'Cannot read property 'replaceAll' of undefined'
…------------------ 原始邮件 ------------------
发件人: "Daniel Jun Suguimoto"<[email protected]>;
发送时间: 2020年2月29日(星期六) 晚上10:01
收件人: "vuejs/vue"<[email protected]>;
抄送: "陈勇君"<[email protected]>; "Author"<[email protected]>;
主题: Re: [vuejs/vue] bug: fix the param 'file' might be undefined (#11160)
Coding a test case could help understand the issue as well
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
posva
reviewed
Aug 25, 2020
@@ -8848,7 +8848,7 @@ function mapIdToFile (id, clientManifest) { | |||
fileIndices.forEach(function (index) { | |||
var file = clientManifest.all[index]; | |||
// only include async files or non-js, non-css assets | |||
if (clientManifest.async.indexOf(file) > -1 || !(/\.(js|css)($|\?)/.test(file))) { | |||
if (clientManifest.async.indexOf(file) > -1 || (file && !(/\.(js|css)($|\?)/.test(file)))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can just drop if there is no file
Suggested change
if (clientManifest.async.indexOf(file) > -1 || (file && !(/\.(js|css)($|\?)/.test(file)))) { | |
if (file && (clientManifest.async.indexOf(file) > -1 || !(/\.(js|css)($|\?)/.test(file))) { |
13 tasks
I'm closing in favor of #11609 which is modifying the right file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
dev
branch for v2.x (or to a previous version branch), not themaster
branchfix #xxx[,#xxx]
, where "xxx" is the issue number)If adding a new feature, the PR's description includes:
Other information:
When using ssr, some error might happen => 'Cannot read property 'replace' of undefined'
The reason is the vue-ssr-client-manifest.json -> modules[i] might contains -1
this cause the file mapper have undefined in an array.