framework7io/framework7 · error · Error
Framework7: Store action
Error message
Framework7: Store action "${actionName}" is not found What it means
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.
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.
Example fix
// before
store.dispatch('incermentCounter'); // typo -> throws
// after
createStore({ actions: { incrementCounter({ state }) { state.count++ } } });
store.dispatch('incrementCounter'); Defensive patterns
Strategy: try-catch
Validate before calling
const ACTIONS = { incrementCounter(state, data) { /* ... */ } };
function safeDispatch(store, name, data) {
if (!store || typeof name !== 'string') throw new TypeError('bad dispatch args');
return name in Object.keys(ACTIONS) ? store.dispatch(name, data) : Promise.reject(new Error(`Unknown action: ${name}`));
} Type guard
function hasAction(store, name) {
return store && store.dispatch && typeof name === 'string' && name.length > 0; // wrap with a known action-name union
} Try / catch
try {
await store.dispatch('incrementCounter', payload);
} catch (err) {
if (err instanceof Error && /Store action .* is not found/.test(err.message)) {
console.error('Unknown store action:', err.message);
} else throw err;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Framework7: can't construct URL for route with name
- Framework7: can't create a View instance because
- Framework7: error constructing route URL from passed…
- Framework7 is already initialized and can't be initialized…
- Framework7: it is not allowed to use router methods on…
AI-assisted analysis of framework7io/framework7@6557591266 (2026-09-02).
Data as JSON: /api/errors/77794adc7f96120c.
Report an issue: GitHub.
Appendix: source
Thrown at src/core/modules/store/create-store.js:131
return getterValue(prop, true);
},
});
store._gettersPlain = new Proxy(getters, {
set: () => false,
get: (target, prop) => {
if (!target[prop]) {
return undefined;
}
return getterValue(prop, false);
},
});
store.dispatch = (actionName, data) => {
return new Promise((resolve, reject) => {
if (!actions[actionName]) {
reject();
throw new Error(`Framework7: Store action "${actionName}" is not found`);
}
const result = actions[actionName]({ state: store.state, dispatch: store.dispatch }, data);
resolve(result);
});
};
return store;
}
export default createStore;
View on GitHub (pinned to 6557591266)