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

fix: check the asset's existence before running filter #9696

Merged
merged 1 commit into from Sep 13, 2019

Conversation

sodatea
Copy link
Contributor

@sodatea sodatea commented Sep 13, 2019

Fixes vuejs/vue-cli#4572

Apparently, the getAsset() call is possible to return an undefined value.

webpack/lib/Compilation.js

Lines 2058 to 2060 in 9c6b367

getAsset(name) {
if (!Object.prototype.hasOwnProperty.call(this.assets, name))
return undefined;

What kind of change does this PR introduce?

A bugfix

Did you add tests for your changes?

Not sure how to get a minimum reproduction of this case but it's an emergency fix.

Does this PR introduce a breaking change?

No.

What needs to be documented once your changes are merged?

Nothing.

@webpack-bot
Copy link
Contributor

For maintainers only:

  • This need to be documented (issue in webpack/webpack.js.org will be filed when merged)

@webpack-bot
Copy link
Contributor

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

@sokra sokra merged commit c5450b4 into webpack:master Sep 13, 2019
@sokra
Copy link
Member

sokra commented Sep 13, 2019

Thanks

@trueleader
Copy link

This is not the only one, a few lines later the next break:

const fileFilter = name => {
const asset = compilation.getAsset(name);
return assetFilter(asset.name, asset.source, asset.info);
};

@Akryum
Copy link
Contributor

Akryum commented Sep 13, 2019

#9701

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

Successfully merging this pull request may close these issues.

vue create default template that will not build
5 participants