Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'forEach') caused by mixing of dev and prod code pinia
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 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
- 平均マージ
- 2日 48分
- マージ済み PR(30日)
- 19
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
vuejs/devtools のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
メンテナーはふだん 2 日以内に返信
-
Upgrade Electron to fix ZIP extraction on Node.js 26対応中かも @ondrhn が 50 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
On the landing site, the "Developer experience" card is redundant再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
vuejs/devtools#975 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 18/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
pingdotgg/t3code#30228 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
ci-cd desktop size:low telemetry-improvement telemetry-round-1
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
vfarcic/dot-agent-deck#2079 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信