Navigation Menu

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

执行 vue ui 命令时出现错误: ERROR TypeError: Cannot read properties of undefined (reading 'on') #7221

Closed
learnguos opened this issue Jul 5, 2022 · 9 comments

Comments

@learnguos
Copy link

Version

5.0.4

Environment info

Environment Info:

  System:
    OS: Windows 10 10.0.22621
    CPU: (16) x64 AMD Ryzen 7 5825U with Radeon Graphics
  Binaries:
    Node: 16.15.0 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 8.10.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: Not Found
    Edge: Chromium (103.0.1264.44)
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

执行 vue ui 命令时出现以下错误语句:

Persisted queries are enabled and are using an unbounded cache. Your server is vulnerable to denial of service attacks via memory exhaustion. Set cache: "bounded" or persistedQueries: false in your ApolloServer constructor, or see https://go.apollo.dev/s/cache-backends for other alternatives.

ERROR TypeError: Cannot read properties of undefined (reading 'on')

TypeError: Cannot read properties of undefined (reading 'on')
at ui (C:\Users\Administrator\AppData\Roaming\npm\node_modules@vue\cli\lib\ui.js:90:14)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

What is expected?

出现的错误给出了解决·方案,但是我不知道如何寻找ApolloServer构造函数设置' cache: "bounded"或者' persistedQueries: false '

What is actually happening?

出现错误语句,浏览器没有打开可视面板

@horans
Copy link

horans commented Jul 6, 2022

it's a new issue, not happened until yesterday.
same situation at 5.0.6, different error thrown at 5.0.7:

TypeError: server.installSubscriptionHandlers is not a function
    at module.exports (C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\@vue\cli-ui\graphql-server.js:165:10)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ui (C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\@vue\cli\lib\ui.js:71:26)

btw, only affects ui command, npm run serve goes fine.

@learnguos
Copy link
Author

这是一个新问题,直到昨天才发生。 相同的情况5.0.6,不同的错误抛出5.0.7

TypeError: server.installSubscriptionHandlers is not a function
    at module.exports (C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\@vue\cli-ui\graphql-server.js:165:10)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ui (C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\@vue\cli\lib\ui.js:71:26)

顺便说一句,只影响 ui 命令,npm run serve一切正常。

Yes, this caused all the 5.x versions I installed to be unusable

@etekweb
Copy link

etekweb commented Jul 6, 2022

I am experiencing this issue after updating Vue-CLI as well. Downgrading back to an older version does not help.

@learnguos
Copy link
Author

更新 Vue-CLI 后我也遇到了这个问题。降级回旧版本没有帮助。

I can fix this by going back to 4.x, and maybe you can try it too.

@etekweb
Copy link

etekweb commented Jul 6, 2022

That does work for me as a workaround for now, though isn't an ideal solution. Especially since the UI feature was working fine on 5.x earlier today.

From digging into vue-cli source a bit, they updated the @vue/cli-ui package's Apollo server today which seems to be causing the issue:
"apollo-server-express": "^3.9.0",

When I downgrade @vue/cli, the updated @vue/cli-ui package (which requires the updated apollo-server-express) doesn't downgrade with it unless I go all the way back to 4.x. From npm list -g apollo-server-express on a downgraded @vue/cli, notice that apollo-server-express is still version 3.9.0:

└─┬ @vue/cli@5.0.5
  └─┬ @vue/cli-ui@5.0.7
    └── apollo-server-express@3.9.0

@RWBDante
Copy link

RWBDante commented Jul 6, 2022

I found that the rollback version did not work because the 5.x dependencies were all 5.x.x, so the rollback cli was still using the 5.0.7 version of the UI. i changed the UI related dependencies to 5.0.6 in the 5.0.6 version of package.json, then reinstalled it and found that it worked. This method is not very safe, a good way would be to use resolution, but I don't know how to install globally using resolution

@learnguos
Copy link
Author

I found that the rollback version did not work because the 5.x dependencies were all 5.x.x, so the rollback cli was still using the 5.0.7 version of the UI. i changed the UI related dependencies to 5.0.6 in the 5.0.6 version of package.json, then reinstalled it and found that it worked. This method is not very safe, a good way would be to use resolution, but I don't know how to install globally using resolution

I have successfully solved this problem according to your suggestion. Thank you very much!

@learnguos
Copy link
Author

learnguos commented Jul 6, 2022

@PsssssssHao @horans @etekweb
如果出现当前的问题我目前的解决方案是:
方案—:
将版本回退到 4.x
方案二:
第一步:请将您的版本回退到 5.0.6 或以下
第二步:删除 node_modules 依赖包文件夹
第三步:请修改 package.json 文件中的代码,以安装的版本 5.0.4为列:
@vue/cli-shared-utils": "^5.0.4" 修改为 @vue/cli-shared-utils": "5.0.4"
@vue/cli-ui": "^5.0.4" 修改为 @vue/cli-ui": "5.0.4"
@vue/cli-ui-addon-webpack": "^5.0.4" 修改为 @vue/cli-ui-addon-webpack": "5.0.4"
@vue/cli-ui-addon-widgets": "^5.0.4" 修改为 @vue/cli-ui-addon-widgets": "5.0.4"

第四步:根据 package.json 文件重新安装依赖即可解决


If there are current problems, my current solutions are as follows:
Solution a:
Roll back version to 4.x
Solution b:
Step 1: Please roll back your version to 5.0.6 or below
Step 2: Delete the node_modules dependency package folder
Step 3: Modify the code in the package.json file as the installed version 5.0.4:
@vue/cli-shared-utils": "^5.0.4" Modified to @vue/cli-shared-utils": "5.0.4"
@vue/cli-ui": "^5.0.4" Modified to @vue/cli-ui": "5.0.4"
@vue/cli-ui-addon-webpack": "^5.0.4" Modified to @vue/cli-ui-addon-webpack": "5.0.4"
@vue/cli-ui-addon-widgets": "^5.0.4" Modified to @vue/cli-ui-addon-widgets": "5.0.4"
Step 4: Reinstall dependencies from package.json

@simpleRobort
Copy link

simpleRobort commented Jul 7, 2022

same problem happened today,, Roll back @vue/cli to 4.x will fix it

@sodatea sodatea closed this as completed in 07052c4 Jul 7, 2022
github-merge-queue bot pushed a commit to chemicaltools/chemicaltools-web that referenced this issue Oct 9, 2023
[![Mend
Renovate](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)

[Compare
Source](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: add
devServer.server.type to useHttps judgement
([vuejs/vue-cli#7222)
-   `@vue/cli-ui`
- [07052c4](https://togithub.com/vuejs/vue-cli/commit/07052c4) fix: Vue
CLI UI graphql subscription server error, fixes
[vuejs/vue-cli#7221

###
[`v5.0.7`](https://togithub.com/vuejs/vue-cli/blob/HEAD/CHANGELOG.md#507-2022-07-05)

[Compare
Source](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)

[Compare
Source](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 Vue
Loader 15.10 (currently in beta).

In Vue 2.7, `vue-template-compiler` is no longer a required peer
dependency. 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)

[Compare
Source](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 file
during 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)

[Compare
Source](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) Better
handling 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 the
dependency 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)

[Compare
Source](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)

[Compare
Source](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)

[Compare
Source](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)

[Compare
Source](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 typo
in 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) replace
master with main to reflect GH default
([@&#8203;anbnyc](https://togithub.com/anbnyc))
- [#&#8203;6359](https://togithub.com/vuejs/vue-cli/pull/6359) Fix
master to main in heroku deployment
([@&#8203;MowlCoder](https://togithub.com/MowlCoder))
- [#&#8203;6266](https://togithub.com/vuejs/vue-cli/pull/6266) Add note
about loader incompatible with webpack 4
([@&#8203;JarnoRFB](https://togithub.com/JarnoRFB))
- [#&#8203;6239](https://togithub.com/vuejs/vue-cli/pull/6239) Update
deployment.md ([@&#8203;anzuj](https://togithub.com/anzuj))
- [#&#8203;6237](https://togithub.com/vuejs/vue-cli/pull/6237) fix code
demo ([@&#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 you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository 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 free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants