uni-app icon indicating copy to clipboard operation
uni-app copied to clipboard

小程序误报 Property "xx" was accessed during render but is not defined on instance

Open justnewbee opened this issue 10 months ago • 4 comments

最小重现代码

<template>
  <view>{{ num }}</view>
</template>

<script lang="ts" setup>
const num = 12345;
</script>

结果

H5 没有问题

小程序报错「[Vue warn]: Property "num" was accessed during render but is not defined on instance. 」

更多信息

刚升级了依赖,升级前没有问题

dev-dep

"@dcloudio/types": "^3.4.8",
"@dcloudio/uni-automator": "3.0.0-4000620240325001",
"@dcloudio/uni-cli-shared": "3.0.0-4000620240325001",
"@dcloudio/uni-stacktracey": "3.0.0-4000620240325001",
"@dcloudio/vite-plugin-uni": "3.0.0-4000620240325001",

dep

"@dcloudio/uni-app": "3.0.0-4000620240325001",
"@dcloudio/uni-app-plus": "3.0.0-4000620240325001",
"@dcloudio/uni-components": "3.0.0-4000620240325001",
"@dcloudio/uni-h5": "3.0.0-4000620240325001",
"@dcloudio/uni-mp-alipay": "3.0.0-4000620240325001",
"@dcloudio/uni-mp-baidu": "3.0.0-4000620240325001",
"@dcloudio/uni-mp-jd": "3.0.0-4000620240325001",
"@dcloudio/uni-mp-kuaishou": "3.0.0-4000620240325001",
"@dcloudio/uni-mp-lark": "3.0.0-4000620240325001",
"@dcloudio/uni-mp-qq": "3.0.0-4000620240325001",
"@dcloudio/uni-mp-toutiao": "3.0.0-4000620240325001",
"@dcloudio/uni-mp-weixin": "3.0.0-4000620240325001",
"@dcloudio/uni-mp-xhs": "3.0.0-4000620240325001",
"@dcloudio/uni-quickapp-webview": "3.0.0-4000620240325001",
"@dcloudio/uni-ui": "^1.5.0",

P.S. 近 1K 的 issue 你们到底在看不看???不要寒了提 Issue 的人的心,大家提 Issue 也是为了帮助你们。

justnewbee avatar Mar 27 '24 01:03 justnewbee

me too, the same error

MuaDou avatar Apr 01 '24 11:04 MuaDou

l miss add "setup" in

MuaDou avatar Apr 01 '24 11:04 MuaDou

l miss add "setup" in

every script in my project uses setup, and this only happens in mp not H5, after i updated the dependencies.

it sure is a regression bug.

justnewbee avatar Apr 09 '24 06:04 justnewbee

试试用ref声明

qhl123456 avatar Apr 09 '24 09:04 qhl123456