You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: