Closed dependabot[bot] closed 2 hours ago
@dependabot rebase
This seems to be caused by:
The behavior changed in 2.2.5 and apparently Pinia is now trying to evaluate
https://github.com/overthesun/simoc-web/blob/000955494c20c10b55bf685cde99c2e04ea1a5ba/src/store/modules/WizardStore.js#L345-L348
as soon as the app is started and the wizard store imported, resulting in an error because store.configuration
is not yet set to an actual configuration object.
I tried to fix the problem by returning early if store.configuration
is not initialized:
diff --git a/src/store/modules/WizardStore.js b/src/store/modules/WizardStore.js
index 0469ea0..1f8adab 100644
--- a/src/store/modules/WizardStore.js
+++ b/src/store/modules/WizardStore.js
@@ -344,6 +344,9 @@ export const useWizardStore = defineStore('WizardStore', {
getTotalMissionHours(state) {
let totalHours = 0
+ if (Object.keys(state.configuration).length === 0) {
+ return totalHours // the config is not initialized yet, return 0
+ }
const durationLength = state.configuration.duration.amount
const durationUnits = state.configuration.duration.units
@@ -361,6 +364,9 @@ export const useWizardStore = defineStore('WizardStore', {
// Returns a formatted configuration object in the format required by the backend.
getFormattedConfiguration(state) {
const config = state.configuration
+ if (Object.keys(config).length === 0) {
+ return {} // the config is not initialized yet, return {}
+ }
// create formatted configuration
const fconfig = {
location: config.location,
This seems to solve the issue for the time being (after I applied a similar fix to getFormattedConfiguration
too), however there might be better solutions.
I'll wait to apply it in case the issue gets fixed upstream.
Superseded by #877.
Bumps pinia from 2.2.4 to 2.2.6.
Release notes
Sourced from pinia's releases.
Commits
c6dd94b
release:@pinia/nuxt
@0
.7.0 pinia@2.2.6@pinia/testing
@0
.1.7e824a8e
chore: up deps9a46b4d
docs: up api gen5694f18
build: up rollup685dcbf
docs: up local copiesfc32faf
chore: up deps90d8eb9
fix: dedupe pinia (#2821)40828b6
docs: note about subscription flush128f435
release:@pinia/nuxt
@0
.6.13dab0a6
fix: upgrade minimum version for nuxt kitDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show