Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: add "devServer.server.type" to "useHttps" judgement#7222

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
haoqunjiang merged 1 commit intovuejs:devfrombackrunner:backrunner-patch-0705
Jul 7, 2022

Conversation

backrunner
Copy link
Contributor

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:

In the recent merged Pull Request#7202 which authored by me, the fixed judgement expression is not perfect, it should also consider thedevServer.server.type because it can be anobject.

This patch add another judgement expression to cover this case, if user setdevServer.server.type tohttps orspdy, theprotocol will behttps.

@haoqunjianghaoqunjiang merged commit0260e4d intovuejs:devJul 7, 2022
@jacekkarczmarczyk
Copy link

jacekkarczmarczyk commentedJul 7, 2022
edited
Loading

With this fix https for the application seems to work fine, however it fails to connect to HMR server:

module.exports=defineConfig({devServer:{server:{type:'https',options:{key:fs.readFileSync('...'),cert:fs.readFileSync('...'),},},},

image

iirc the following config worked in vue cli 4/webpack 4

devServer:{https:{key:fs.readFileSync('...'),cert:fs.readFileSync('...'),},},

@backrunner
Copy link
ContributorAuthor

backrunner commentedJul 7, 2022
edited
Loading

With this fix https for the application seems to work fine, however it fails to connect to HMR server:

module.exports=defineConfig({devServer:{server:{type:'https',options:{key:fs.readFileSync('...'),cert:fs.readFileSync('...'),},},},

image

iirc the following config worked in vue cli 4/webpack 4

devServer:{https:{key:fs.readFileSync('...'),cert:fs.readFileSync('...'),},},

Your case is similar to#7160, ifNODE_ENV is notproduction,@vue/cli-service always prefer using the lan IP aswebSocketURL. I think that might not work properly in some scenarios. You can try to setdevServer.client.webSocketURL toauto://localhost:[YOUR_SERVER_PORT]/ws and setdevServer.allowedHosts toall if you're running the dev server at local.

jacekkarczmarczyk reacted with thumbs up emojinodruob13 reacted with heart emoji

@jacekkarczmarczyk
Copy link

Thanks@backrunner
Following config works fine for me

devServer:{server:{type:'https',options:{key:fs.readFileSync('...'),cert:fs.readFileSync('...'),},},client:{webSocketURL:'auto://localhost:8081/ws',},allowedHosts:'all',},

@lyanerzhang
Copy link

 devServer: {    server: {      type: "https",      // options: {      //   key: fs.readFileSync("/Users/li/server.key"),      //   cert: fs.readFileSync("/Users/li/server.crt")      // }    },    client: {      webSocketURL: "https://localhost:4003/"    },    allowedHosts: ["all"],    overlay: {      warnings: false,      errors: false    },    headers: {      "Access-Control-Allow-Origin": "*"    },    // host: "192.168.1.8",    port: 4003, // 端口号    // https: true,    // open: false, //配置自动启动浏览器    hot: true, // 热更新    hotOnly: true,    disableHostCheck: true,    proxy: {      "/api": {        target: "https://yanshou4.xxx.com/", // 测试环境        changeOrigin: true,        pathRewrite: {          "^/": "/"        }      }    }  }

增加了上述配置后,报错了
image

github-merge-queuebot referenced this pull request in chemicaltools/chemicaltools-webOct 9, 2023
[![MendRenovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)This PR contains the following updates:| Package | Change | Age | Adoption | Passing | Confidence ||---|---|---|---|---|---||[@vue/cli-plugin-babel](https://togithub.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-plugin-babel#readme)([source](https://togithub.com/vuejs/vue-cli)) | [`4.5.19` ->`5.0.8`](https://renovatebot.com/diffs/npm/@vue%2fcli-plugin-babel/4.5.19/5.0.8)|[![age](https://developer.mend.io/api/mc/badges/age/npm/@vue%2fcli-plugin-babel/5.0.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)|[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@vue%2fcli-plugin-babel/5.0.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)|[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@vue%2fcli-plugin-babel/4.5.19/5.0.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)|[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@vue%2fcli-plugin-babel/4.5.19/5.0.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)||[@vue/cli-plugin-eslint](https://togithub.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-plugin-eslint#readme)([source](https://togithub.com/vuejs/vue-cli)) | [`4.5.19` ->`5.0.8`](https://renovatebot.com/diffs/npm/@vue%2fcli-plugin-eslint/4.5.19/5.0.8)|[![age](https://developer.mend.io/api/mc/badges/age/npm/@vue%2fcli-plugin-eslint/5.0.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)|[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@vue%2fcli-plugin-eslint/5.0.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)|[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@vue%2fcli-plugin-eslint/4.5.19/5.0.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)|[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@vue%2fcli-plugin-eslint/4.5.19/5.0.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)||[@vue/cli-plugin-pwa](https://togithub.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-plugin-pwa#readme)([source](https://togithub.com/vuejs/vue-cli)) | [`4.5.19` ->`5.0.8`](https://renovatebot.com/diffs/npm/@vue%2fcli-plugin-pwa/4.5.19/5.0.8)|[![age](https://developer.mend.io/api/mc/badges/age/npm/@vue%2fcli-plugin-pwa/5.0.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)|[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@vue%2fcli-plugin-pwa/5.0.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)|[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@vue%2fcli-plugin-pwa/4.5.19/5.0.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)|[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@vue%2fcli-plugin-pwa/4.5.19/5.0.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)|| [@vue/cli-service](https://cli.vuejs.org/)([source](https://togithub.com/vuejs/vue-cli)) | [`4.5.19` ->`5.0.8`](https://renovatebot.com/diffs/npm/@vue%2fcli-service/4.5.19/5.0.8)|[![age](https://developer.mend.io/api/mc/badges/age/npm/@vue%2fcli-service/5.0.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)|[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@vue%2fcli-service/5.0.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)|[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@vue%2fcli-service/4.5.19/5.0.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)|[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@vue%2fcli-service/4.5.19/5.0.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)|---### Release Notes<details><summary>vuejs/vue-cli (@&#8203;vue/cli-plugin-babel)</summary>### [`v5.0.8`](https://togithub.com/vuejs/vue-cli/releases/tag/v5.0.8)[CompareSource](https://togithub.com/vuejs/vue-cli/compare/v5.0.7...v5.0.8)##### 🐛 Bug Fix-   `@vue/cli-service`- [0260e4d](https://togithub.com/vuejs/vue-cli/commit/0260e4d) fix: adddevServer.server.type to useHttps judgement([https://github.com/vuejs/vue-cli/pull/7222](https://togithub.com/vuejs/vue-cli/pull/7222))-   `@vue/cli-ui`- [07052c4](https://togithub.com/vuejs/vue-cli/commit/07052c4) fix: VueCLI UI graphql subscription server error, fixes[https://github.com/vuejs/vue-cli/issues/7221](https://togithub.com/vuejs/vue-cli/issues/7221)###[`v5.0.7`](https://togithub.com/vuejs/vue-cli/blob/HEAD/CHANGELOG.md#507-2022-07-05)[CompareSource](https://togithub.com/vuejs/vue-cli/compare/v5.0.6...v5.0.7)-   `@vue/cli-service`- [#&#8203;7202](https://togithub.com/vuejs/vue-cli/pull/7202),\[[558dea2](https://togithub.com/vuejs/vue-cli/commit/558dea2)] fix:support `devServer.server` option, avoid deprecation warnings([@&#8203;backrunner](https://togithub.com/backrunner),[@&#8203;sodatea](https://togithub.com/sodatea))- \[[beffe8a](https://togithub.com/vuejs/vue-cli/commit/beffe8a)] fix:allow disabling progress plugin via `devServer.client.progress`-   `@vue/cli-ui`- [#&#8203;7210](https://togithub.com/vuejs/vue-cli/pull/7210) chore:upgrade to apollo-server-express 3.x##### Committers: 2-   BackRunner ([@&#8203;backrunner](https://togithub.com/backrunner))-   Haoqun Jiang ([@&#8203;sodatea](https://togithub.com/sodatea))###[`v5.0.6`](https://togithub.com/vuejs/vue-cli/blob/HEAD/CHANGELOG.md#506-2022-06-16)[CompareSource](https://togithub.com/vuejs/vue-cli/compare/v5.0.5...v5.0.6)Fix compatibility with the upcoming Vue 2.7 (currently in alpha) and VueLoader 15.10 (currently in beta).In Vue 2.7, `vue-template-compiler` is no longer a required peerdependency. Rather, there's a new export under the main package as`vue/compiler-sfc`.###[`v5.0.5`](https://togithub.com/vuejs/vue-cli/blob/HEAD/CHANGELOG.md#505-2022-06-16)[CompareSource](https://togithub.com/vuejs/vue-cli/compare/v5.0.4...v5.0.5)##### 🐛 Bug Fix-   `@vue/cli`- [#&#8203;7167](https://togithub.com/vuejs/vue-cli/pull/7167)feat(upgrade): prevent changing the structure of package.json fileduring upgrade ([@&#8203;blzsaa](https://togithub.com/blzsaa))-   `@vue/cli-service`- [#&#8203;7023](https://togithub.com/vuejs/vue-cli/pull/7023) fix:windows vue.config.mjs support([@&#8203;xiaoxiangmoe](https://togithub.com/xiaoxiangmoe))##### Committers: 3-   Martijn Jacobs ([@&#8203;maerteijn](https://togithub.com/maerteijn))- ZHAO Jinxiang([@&#8203;xiaoxiangmoe](https://togithub.com/xiaoxiangmoe))-   [@&#8203;blzsaa](https://togithub.com/blzsaa)###[`v5.0.4`](https://togithub.com/vuejs/vue-cli/blob/HEAD/CHANGELOG.md#504-2022-03-22)[CompareSource](https://togithub.com/vuejs/vue-cli/compare/v5.0.3...v5.0.4)##### 🐛 Bug Fix-   `@vue/cli-service`- [#&#8203;7005](https://togithub.com/vuejs/vue-cli/pull/7005) Betterhandling of `publicPath: 'auto'`([@&#8203;AndreiSoroka](https://togithub.com/AndreiSoroka))-   `@vue/cli-shared-utils`, `@vue/cli-ui`- [75826d6](https://togithub.com/vuejs/vue-cli/commit/75826d6) fix:replace `node-ipc` with `@achrinza/node-ipc` to further secure thedependency chain##### Committers: 1-   Andrei ([@&#8203;AndreiSoroka](https://togithub.com/AndreiSoroka))-   Haoqun Jiang ([@&#8203;sodatea](https://togithub.com/sodatea))###[`v5.0.3`](https://togithub.com/vuejs/vue-cli/blob/HEAD/CHANGELOG.md#503-2022-03-15)[CompareSource](https://togithub.com/vuejs/vue-cli/compare/v5.0.2...v5.0.3)##### 🐛 Bug Fix-   `@vue/cli-shared-utils`, `@vue/cli-ui`    -   Lock `node-ipc` to v9.2.1###[`v5.0.2`](https://togithub.com/vuejs/vue-cli/blob/HEAD/CHANGELOG.md#502-2022-03-15)[CompareSource](https://togithub.com/vuejs/vue-cli/compare/v5.0.1...v5.0.2)##### 🐛 Bug Fix-   `@vue/cli-service`- [#&#8203;7044](https://togithub.com/vuejs/vue-cli/pull/7044)fix(cli-service): devServer proxy should be optional([@&#8203;ntnyq](https://togithub.com/ntnyq))- [#&#8203;7039](https://togithub.com/vuejs/vue-cli/pull/7039) chore:add scss to LoaderOptions([@&#8203;hiblacker](https://togithub.com/hiblacker))##### Committers: 2-   Blacker ([@&#8203;hiblacker](https://togithub.com/hiblacker))-   ntnyq ([@&#8203;ntnyq](https://togithub.com/ntnyq))###[`v5.0.1`](https://togithub.com/vuejs/vue-cli/blob/HEAD/CHANGELOG.md#501-2022-02-17)[CompareSource](https://togithub.com/vuejs/vue-cli/compare/v5.0.0...v5.0.1)Same as 5.0.0.###[`v5.0.0`](https://togithub.com/vuejs/vue-cli/blob/HEAD/CHANGELOG.md#500-2022-02-17)[CompareSource](https://togithub.com/vuejs/vue-cli/compare/v4.5.19...v5.0.0)##### 🐛 Bug Fix-   `@vue/cli-service`- [#&#8203;6972](https://togithub.com/vuejs/vue-cli/pull/6972) Remove--skip-plugin from arguments([@&#8203;MatthijsBurgh](https://togithub.com/MatthijsBurgh))- [#&#8203;6987](https://togithub.com/vuejs/vue-cli/pull/6987) fix:update mini-css-extract-plugin to ^2.5.3([@&#8203;darrinmn9](https://togithub.com/darrinmn9))##### 📝 Documentation- [#&#8203;6706](https://togithub.com/vuejs/vue-cli/pull/6706) docs:update vue create --help output in "Basics/Creating a Project"([@&#8203;Lalaluka](https://togithub.com/Lalaluka))- [#&#8203;6642](https://togithub.com/vuejs/vue-cli/pull/6642) docs:Update README.md ([@&#8203;wxsms](https://togithub.com/wxsms))- [#&#8203;6620](https://togithub.com/vuejs/vue-cli/pull/6620) Fix typoin deployment guide ([@&#8203;Klikini](https://togithub.com/Klikini))- [#&#8203;6623](https://togithub.com/vuejs/vue-cli/pull/6623)fix(docs): the plugin-dev in zh has a regexp lose the end /([@&#8203;HelloJiya](https://togithub.com/HelloJiya))- [#&#8203;6377](https://togithub.com/vuejs/vue-cli/pull/6377) replacemaster with main to reflect GH default([@&#8203;anbnyc](https://togithub.com/anbnyc))- [#&#8203;6359](https://togithub.com/vuejs/vue-cli/pull/6359) Fixmaster to main in heroku deployment([@&#8203;MowlCoder](https://togithub.com/MowlCoder))- [#&#8203;6266](https://togithub.com/vuejs/vue-cli/pull/6266) Add noteabout loader incompatible with webpack 4([@&#8203;JarnoRFB](https://togithub.com/JarnoRFB))- [#&#8203;6239](https://togithub.com/vuejs/vue-cli/pull/6239) Updatedeployment.md ([@&#8203;anzuj](https://togithub.com/anzuj))- [#&#8203;6237](https://togithub.com/vuejs/vue-cli/pull/6237) fix codedemo ([@&#8203;yyzclyang](https://togithub.com/yyzclyang))##### Committers: 13-   Alec Barrett ([@&#8203;anbnyc](https://togithub.com/anbnyc))- Alexander Sokolov([@&#8203;Alex-Sokolov](https://togithub.com/Alex-Sokolov))-   Andy Castille ([@&#8203;Klikini](https://togithub.com/Klikini))-   Anzelika  ([@&#8203;anzuj](https://togithub.com/anzuj))- Ben Hutton ([@&#8203;Relequestual](https://togithub.com/Relequestual))-   Calvin Schröder ([@&#8203;Lalaluka](https://togithub.com/Lalaluka))- Darrin Nagengast ([@&#8203;darrinmn9](https://togithub.com/darrinmn9))- Matthijs van der Burgh([@&#8203;MatthijsBurgh](https://togithub.com/MatthijsBurgh))-   Rüdiger Busche ([@&#8203;JarnoRFB](https://togithub.com/JarnoRFB))-   [@&#8203;HelloJiya](https://togithub.com/HelloJiya)-   [@&#8203;MowlCoder](https://togithub.com/MowlCoder)-   wxsm ([@&#8203;wxsms](https://togithub.com/wxsms))-   鱼依藻常乐 ([@&#8203;yyzclyang](https://togithub.com/yyzclyang))</details>---### Configuration📅 **Schedule**: Branch creation - At any time (no schedule defined),Automerge - At any time (no schedule defined).🚦 **Automerge**: Disabled by config. Please merge this manually once youare satisfied.♻ **Rebasing**: Whenever PR becomes conflicted, or you tick therebase/retry checkbox.🔕 **Ignore**: Close this PR and you won't be reminded about theseupdates again.---- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, checkthis box---This PR has been generated by [MendRenovate](https://www.mend.io/free-developer-tools/renovate/). Viewrepository job log[here](https://developer.mend.io/github/chemicaltools/chemicaltools-web).<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xNTQuOSIsInVwZGF0ZWRJblZlciI6IjM2LjguMTEiLCJ0YXJnZXRCcmFuY2giOiJtYXN0ZXIifQ==-->Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@haoqunjianghaoqunjianghaoqunjiang approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@backrunner@jacekkarczmarczyk@lyanerzhang@haoqunjiang

[8]ページ先頭

©2009-2025 Movatter.jp