Skip to content

chore: use webpack-chain v6.5.1 #6157

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

Merged
merged 1 commit into from
Dec 20, 2020
Merged

Conversation

cexbrayat
Copy link
Member

Vue CLI v5.0.0-alpha.0 uses rule.resolve in the CLI service (see https://github.com/vuejs/vue-cli/blob/v5.0.0-alpha.0/packages/@vue/cli-service/lib/config/base.js#L17-L20) which was introduced in webpack-chain v6.5.0.

See https://github.com/neutrinojs/webpack-chain/blob/master/CHANGELOG.md#v650

As the CLI service defines a dependency to webpack-chain v6.4.0, this causes issues in existing projects when trying to upgrade to the CLI v5.

Upgrading an existing project leads to yarn build throwing:

TypeError: Cannot read property 'set' of undefined
    at /Users/ced-pro/Code/ninjasquad/vue-ebook/book-tests/node_modules/@vue/cli-service/lib/config/base.js:20:19
    at /Users/ced-pro/Code/ninjasquad/vue-ebook/book-tests/node_modules/@vue/cli-service/lib/Service.js:240:40
    at Array.forEach (<anonymous>)
    at Service.resolveChainableWebpackConfig (/Users/ced-pro/Code/ninjasquad/vue-ebook/book-tests/node_modules/@vue/cli-service/lib/Service.js:240:26)
    at PluginAPI.resolveChainableWebpackConfig (/Users/ced-pro/Code/ninjasquad/vue-ebook/book-tests/node_modules/@vue/cli-service/lib/PluginAPI.js:145:25)
    at module.exports (/Users/ced-pro/Code/ninjasquad/vue-ebook/book-tests/node_modules/@vue/cli-service/lib/commands/build/resolveAppConfig.js:9:22)
    at build (/Users/ced-pro/Code/ninjasquad/vue-ebook/book-tests/node_modules/@vue/cli-service/lib/commands/build/index.js:147:50)
    at /Users/ced-pro/Code/ninjasquad/vue-ebook/book-tests/node_modules/@vue/cli-service/lib/commands/build/index.js:89:13
    at Service.run (/Users/ced-pro/Code/ninjasquad/vue-ebook/book-tests/node_modules/@vue/cli-service/lib/Service.js:234:12)
    at Object.<anonymous> (/Users/ced-pro/Code/ninjasquad/vue-ebook/book-tests/node_modules/@vue/cli-service/bin/vue-cli-service.js:36:9)

This fixes the issue by specifying the necesseray minimal version for webpack-chain.

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Underlying tools
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

Other information:

Copy link
Collaborator

@fangbinwei fangbinwei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not bump version to 6.5.1 directly ? But not a big problem

Vue CLI v5.0.0-alpha.0 uses `rule.resolve` in the CLI service (see https://github.com/vuejs/vue-cli/blob/v5.0.0-alpha.0/packages/@vue/cli-service/lib/config/base.js#L17-L20) which was introduced in webpack-chain v6.5.0.

As the CLI service defines a dependency to webpack-chain v6.4.0, this causes issues in existing projects when trying to upgrade to the CLi v5.

Upgrading an existing project leads to `yarn build` throwing:

```
TypeError: Cannot read property 'set' of undefined
    at /Users/ced-pro/Code/ninjasquad/vue-ebook/book-tests/node_modules/@vue/cli-service/lib/config/base.js:20:19
    at /Users/ced-pro/Code/ninjasquad/vue-ebook/book-tests/node_modules/@vue/cli-service/lib/Service.js:240:40
    at Array.forEach (<anonymous>)
    at Service.resolveChainableWebpackConfig (/Users/ced-pro/Code/ninjasquad/vue-ebook/book-tests/node_modules/@vue/cli-service/lib/Service.js:240:26)
    at PluginAPI.resolveChainableWebpackConfig (/Users/ced-pro/Code/ninjasquad/vue-ebook/book-tests/node_modules/@vue/cli-service/lib/PluginAPI.js:145:25)
    at module.exports (/Users/ced-pro/Code/ninjasquad/vue-ebook/book-tests/node_modules/@vue/cli-service/lib/commands/build/resolveAppConfig.js:9:22)
    at build (/Users/ced-pro/Code/ninjasquad/vue-ebook/book-tests/node_modules/@vue/cli-service/lib/commands/build/index.js:147:50)
    at /Users/ced-pro/Code/ninjasquad/vue-ebook/book-tests/node_modules/@vue/cli-service/lib/commands/build/index.js:89:13
    at Service.run (/Users/ced-pro/Code/ninjasquad/vue-ebook/book-tests/node_modules/@vue/cli-service/lib/Service.js:234:12)
    at Object.<anonymous> (/Users/ced-pro/Code/ninjasquad/vue-ebook/book-tests/node_modules/@vue/cli-service/bin/vue-cli-service.js:36:9)
```

This fixes the issue by specifying the necesseray minimal version for webpack-chain.
@haoqunjiang haoqunjiang merged commit d743514 into vuejs:dev Dec 20, 2020
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

Successfully merging this pull request may close these issues.

3 participants