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

Warnings on console when using Menu component #3998

Closed
1 task
ais-one opened this issue Apr 27, 2021 · 69 comments
Closed
1 task

Warnings on console when using Menu component #3998

ais-one opened this issue Apr 27, 2021 · 69 comments

Comments

@ais-one
Copy link

ais-one commented Apr 27, 2021

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

2.1.3

Environment

Windows 10, Chrome 89, Vue 3.0.11

Reproduction link

https://2x.antdv.com/components/menu

Steps to reproduce

Use the example code for Menu, with version ant-design-vue version 2.1.3

What is expected?

It is working properly but...

What is actually happening?

There is warnings in the console

reactivity.esm-bundler.js:337 Set operation on key "" failed: target is readonly. {: 1, __vInternal: 1, default: ƒ}

@jiubanqingchen
Copy link

我这边也出现了同样的问题,目前还不知道是啥原因,就是更新了新的版本之后就冒出来了

@kriszheng-cashwerkz
Copy link

kriszheng-cashwerkz commented Apr 27, 2021

The same warnings occur when hovering or clicking on menu items. It does not have any impact to the functionalities and the warnings don't show after build.

@zkwolf
Copy link
Member

zkwolf commented Apr 27, 2021

似乎没复现出来,哪个例子有问题我去试试

@lemonchip
Copy link

I also had the same problem :the console warning Set operation on key "xxxx" failed: target is readonly.

@liulei92
Copy link

I also had the same problem :the console warning Set operation on key "xxxx" failed: target is readonly.

i, too

@liulei92
Copy link

具体demo
warning:Set operation on key "expandIcon" failed: target is readonly.

munu中使用了
<template #expandIcon> <i class="icomoon icon-arrow_right"></i> </template>
自定义了expandIcon

@bao2314483
Copy link

我也是出現這個問題,報錯誤是Set operation on key "default" failed: target is readonly.
引起這個錯誤的代碼是如下

<a-menu theme="dark" mode="inline" v-model:selectedKeys="SelectedKeys" @click="OnMuenClick">
        <a-menu-item v-for="Item in Routers" :key="Item.name">
          <SvgIcon :name="Item.meta?.icon" />
          <span>{{ Item.meta?.title }}</span>
        </a-menu-item>
      </a-menu>

@reaink
Copy link

reaink commented Apr 27, 2021

俺也一样
The same for me

@rmlzy
Copy link

rmlzy commented Apr 28, 2021

mark

@rmlzy
Copy link

rmlzy commented Apr 28, 2021

v2.1.2 没有此问题

@zkwolf
Copy link
Member

zkwolf commented Apr 28, 2021

检查一下warning的vue版本?

@bao2314483
Copy link

v2.1.2 没有此问题

升級了2.1.3就出現了

@rmlzy
Copy link

rmlzy commented Apr 28, 2021

@zkwolf vue@3.0.11

@jiubanqingchen
Copy link

检查一下warning的vue版本?

我前天试过,将vue版本回退到3.0.6也不行,3.0.11也是一样会出先这个问题,用的vite

@ndrshn
Copy link

ndrshn commented Apr 28, 2021

vue@3.0.11
ant-design-vue@2.1.2
vite@2.1.5

same warnings

@reaink
Copy link

reaink commented Apr 28, 2021

"vue": "3.0.11",
"ant-design-vue": "2.1.3",
"vite": "^2.2.3",

There is this warning message

@zkwolf
Copy link
Member

zkwolf commented Apr 28, 2021

It seems that only vite env will report this warning, I reproduce this warning with vite@2.2.3. Is there anyone have this warning without vite env?

@huangzhengyon
Copy link

I had the same problem

@TimRChen
Copy link

mark.

@bandaoqiu
Copy link

vue@3.0.11
ant-design-vue@2.1.3
vite@2.2.3

same warning

@JobinJia
Copy link
Contributor

mark

@zjlovezj
Copy link

"mark" or "I have the same problem" is very annoying, please stop spamming this thread.

@rmlzy
Copy link

rmlzy commented Apr 29, 2021

It seems that only vite env will report this warning, I reproduce this warning with vite@2.2.3. Is there anyone have this warning without vite env?

@vue/cli-service 4.5.12

zkwolf added a commit to zkwolf/ant-design-vue that referenced this issue Apr 29, 2021
@ais-one
Copy link
Author

ais-one commented Apr 30, 2021

If it helps... this is the versions that I see the problem, my env is vite

"vue": "^3.0.11",
"@vitejs/plugin-vue": "^1.2.2",
"@vue/compiler-sfc": "^3.0.11",
"vite": "^2.2.3"

@fengbaoheng
Copy link

鼠标滑过Menu组件时报这个问题,也是最近更新过依赖版本后才有的
"dependencies": {
"@ant-design/icons-vue": "^6.0.1",
"ant-design-vue": "^2.1.2",
"vue": "^3.0.11",
"vuex": "^4.0.0"
},

@tangjinzhou
Copy link
Member

tangjinzhou commented Apr 30, 2021

use vue 3.0.10

ref vuejs/core#3695

@fengbaoheng
Copy link

use vue 3.0.10

ref vuejs/vue-next#3695

I've tried, but it's still unresolved.
"ant-design-vue": "^2.1.2",
"vue": "^3.0.10"

@tuyutian
Copy link

用的异步数据更新SubMenu的时候,就会这样,连带着其他固定写死的副菜单也会报这个warning,鼠标一移上去就会
DB5C0BE9-B8D7-44ed-91CD-F936D764C178
"dependencies": {
"@ant-design/icons-vue": "^6.0.1",
"ant-design-vue": "^2.1.3",
"axios": "^0.21.1",
"vue": "^3.0.11",
}
移上去报一批移下来报一批

@tangjinzhou
Copy link
Member

vue 同步使用 3.0.10
依然还有少量 warning ,等待 vue 修复了

@ais-one
Copy link
Author

ais-one commented May 13, 2021

我的菜单有50多个,每次热更新之后就会报警告,改几次代码之后警告4000多个,当场卡死😭😭😭😭😭

I am requesting for vue team the increase the urgency from p3-minor-bug, it should be p1

vuejs/core#3695 (comment)

@zhenzhenChange
Copy link

我的菜单有50多个,每次热更新之后就会报警告,改几次代码之后警告4000多个,当场卡死😭😭😭😭😭

I am requesting for vue team the increase the urgency from p3-minor-bug, it should be p1

vuejs/vue-next#3695 (comment)

Good brother thank you ~

After replacing this item with v2.1.6 for my 50+ menus, the warning was removed and another small item was synchronized with the version and there was actually, hahaha my goodness

@zhenzhenChange
Copy link

vue 同步使用 3.0.10
依然还有少量 warning ,等待 vue 修复了

辛苦了

@Kunkka0229
Copy link

同样的问题

@jackywu
Copy link

jackywu commented May 16, 2021

还没有最终解决么?菜鸟也踏入此坑了。

@bao2314483
Copy link

update 2.1.6

我刚刚试了2.16
vue:3.0.10
依然有警告

@lizaiya
Copy link

lizaiya commented May 21, 2021

我刚刚试了2.16
vue:3.0.10
依然有警告

@ais-one
Copy link
Author

ais-one commented May 21, 2021

Hi All,

If you want to bring the issue to attention of VueJS maintainers, the issue link is here...

vuejs/core#3695

@arthur-0595
Copy link

mark!

@chenhaizano
Copy link

mark

package.json dependencies

"ant-design-vue": "^2.1.6",
"vue": "^3.0.0",

components

Menu

warn

Set operation on key "default" failed: target is readonly.

@pprory
Copy link

pprory commented May 25, 2021

mark!

@wwhsuccess
Copy link

还是这个问题,一直没法解决。

@zhangshaoying19
Copy link

zhangshaoying19 commented May 27, 2021

"ant-design-vue": "2.1.2",
"vue": "3.0.11",

"vite":^2.3.3

no warning

@ais-one
Copy link
Author

ais-one commented May 28, 2021

Hi,

The fixes have been merged... vuejs/core#3698

Please wait for the next update of vue-next, and then try out the fixes.

The fix for this issue currently depends on vue and not ant-design-vue team.

@xiaohuaye
Copy link

mark

@dokodream
Copy link

image
image
只要是修改:selectedKeys的引用值就会报这个问题,不是vue的问题

@qinyugithub
Copy link

version 2.1.6;
vue@3.0.10 ;
still warnings

@fuyongshuai7
Copy link

mark

@qiuyaofan
Copy link

v2.1.2 没有此问题

然而,vite build会报错~
#3895

@catelina95
Copy link

"vue": "^3.0.0",
"ant-design-vue": "2.1.6",
still warngings.....

@catelina95
Copy link

"ant-design-vue": "2.1.2",
"vue": "3.0.11",

"vite":^2.3.3

no warning

实测可用!!! "ant-design-vue": "2.1.6" 却报错!!

@ais-one
Copy link
Author

ais-one commented Jun 8, 2021

vue 3.1.1 has no more warnings, but a problem with layout is created...

#4173

@335296558
Copy link

335296558 commented Jun 12, 2021

The version I use is:
"vite": "2.1.5"
"vue": "3.0.10" || "vue": "3.0.11"
Both Set operation on key "default" failed: target is readonly. Question。

Then I updated vue to "vue": "3.1.1" The problem was solved

把vue 更新到 "vue": "3.1.1" 就好了

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests