{"record":{"id":"77794adc7f96120c","repo":"framework7io/framework7","slug":"framework7-store-action-actionname-is-not-fo","errorCode":null,"errorMessage":"Framework7: Store action \"${actionName}\" is not found","messagePattern":"Framework7: Store action \"(.+?)\" is not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/core/modules/store/create-store.js","lineNumber":131,"sourceCode":"      return getterValue(prop, true);\n    },\n  });\n\n  store._gettersPlain = new Proxy(getters, {\n    set: () => false,\n    get: (target, prop) => {\n      if (!target[prop]) {\n        return undefined;\n      }\n      return getterValue(prop, false);\n    },\n  });\n\n  store.dispatch = (actionName, data) => {\n    return new Promise((resolve, reject) => {\n      if (!actions[actionName]) {\n        reject();\n        throw new Error(`Framework7: Store action \"${actionName}\" is not found`);\n      }\n      const result = actions[actionName]({ state: store.state, dispatch: store.dispatch }, data);\n      resolve(result);\n    });\n  };\n\n  return store;\n}\n\nexport default createStore;\n","sourceCodeStart":113,"sourceCodeEnd":142,"githubUrl":"https://github.com/framework7io/framework7/blob/655759126686766530a027b2f8f369c991d63d1c/src/core/modules/store/create-store.js#L113-L142","documentation":"createStore's dispatch looks up the action name in the store's actions map; if it is not present, it rejects the returned Promise and throws synchronously. The library does this to surface typos or missing action registrations immediately instead of silently returning undefined.","triggerScenarios":"Calling store.dispatch('someAction', data) where 'someAction' was not defined in the actions object passed to createStore, or dispatching before the store module with that action is registered.","commonSituations":"Typo in the action name at the dispatch site; action defined in a different store than the one dispatched on; renaming/removing an action without updating all dispatch call sites; accessing the store before a lazily-registered module's actions are installed.","solutions":["Verify the action name is defined in the actions object passed to createStore and fix any typo.","Dispatch on the correct store instance if multiple stores exist.","Add the missing action to the store's actions definition.","Use store.getters to check available state instead of dispatching if the action was never intended to exist."],"exampleFix":"// before\nstore.dispatch('incermentCounter'); // typo -> throws\n// after\ncreateStore({ actions: { incrementCounter({ state }) { state.count++ } } });\nstore.dispatch('incrementCounter');","handlingStrategy":"try-catch","validationCode":"const ACTIONS = { incrementCounter(state, data) { /* ... */ } };\nfunction safeDispatch(store, name, data) {\n  if (!store || typeof name !== 'string') throw new TypeError('bad dispatch args');\n  return name in Object.keys(ACTIONS) ? store.dispatch(name, data) : Promise.reject(new Error(`Unknown action: ${name}`));\n}","typeGuard":"function hasAction(store, name) {\n  return store && store.dispatch && typeof name === 'string' && name.length > 0; // wrap with a known action-name union\n}","tryCatchPattern":"try {\n  await store.dispatch('incrementCounter', payload);\n} catch (err) {\n  if (err instanceof Error && /Store action .* is not found/.test(err.message)) {\n    console.error('Unknown store action:', err.message);\n  } else throw err;\n}","preventionTips":["Define action names as constants or a TypeScript union shared between createStore and call sites.","Keep actions next to the store that owns them to avoid dispatching on the wrong store.","Grep dispatch( call sites when renaming/removing actions."],"tags":["store","state-management","framework7","dispatch"],"backgroundTag":"unknown-action-dispatch","analyzedSha":"655759126686766530a027b2f8f369c991d63d1c","analyzedAt":"2026-09-02T19:48:40.711Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}