Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'forEach') caused by mixing of dev and prod code pinia
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- webpack
调研方向
首先使用 webpack dev server、启用的 devtools 以及共享的生产构建 store 包重现该错误。检查 pinia.mjs:803 和 prepare.js 中的堆栈位置;当开发和生产 store 代码混用不再导致报告的异常,并且生产 store 按描述得到处理时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Hi,
I'm using a microfrontend architecture, where each MF has its own pinia. Pinia is created and destroyed properly per each application.
Mostly, the code for the stores is completely unrelated.
However, there are few cases where we are sharing specific store code (such as "notification store", which is same for all apps).
The shared store code is used via a library, that has its own versioning, is installed via yarn, and is production build.
When running the application in dev mode (using webpack and webpack dev server) when dev tools is disabled, all is good.
When enabling devtools, suddenly errors appear, a common one being:
pinia.mjs:803 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'forEach')
at pinia.mjs:803:1
at bt (prepare.js:1:63085)
at prepare.js:1:68771
at prepare.js:1:33623
at prepare.js:1:33615
After a while, trying to figure out what causes this issue, I noticed that when I install the shared code package in development build, these errors are gone, which led me to the conclusion that mixed production-dev builds of store code are causing issues in dev tools.
I understand that development build is needed in order to explore the pinia stores on devtools, but I think in such a case, the "production" stores should just not be visible for exploration in the devtools, instead of causing exceptions.
Thanks
- 主要语言
- TypeScript
- 星标
- 2.9k
- 派生
- 291
- 平均合并
- 4 天 6 分钟
- 30 天内合并 PR
- 27
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
vuejs/devtools 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 69/100
维护者通常 3 天内回复
-
Upgrade Electron to fix ZIP extraction on Node.js 26可能已有人在做 @ondrhn 于 53 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 3 天内回复
-
On the landing site, the "Developer experience" card is redundant可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 1/5 1 小时以内 新手友好度 72/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 3 天内回复
-
难度 5/5 一周以上 新手友好度 18/100
维护者通常 3 天内回复
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
pending close triaging
难度 2/5 1-3 小时 新手友好度 78/100
anomalyco/opencode#62582 · 1 条评论 ·
维护者通常 1 天内回复
-
feature request
难度 2/5 1-3 小时 新手友好度 72/100
callstack/react-native-paper#5189 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
live-codes/livecodes#1079 · 1 条评论 ·
维护者通常 1 天内回复
-
Add: ESP 2 RO未关闭approved check:passed streams:add
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复