framework7io/framework7 · error · Error

Framework7: Store action "${actionName}" is not found

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.

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)

Solutions

  1. Verify the action name is defined in the actions object passed to createStore and fix any typo.
  2. Dispatch on the correct store instance if multiple stores exist.
  3. Add the missing action to the store's actions definition.
  4. 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

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


AI-assisted analysis of framework7io/framework7@6557591266 (2026-09-02). Data as JSON: /api/errors/77794adc7f96120c. Report an issue: GitHub.