balderdashy/sails · warning

${warning} was bound to a target `${actionGlob}` that doesn'

Error message

${warning} was bound to a target `${actionGlob}` that doesn't match any registered actions.

What it means

Sails custom routes can bind URL patterns to action globs (e.g. 'UserController.*'). When a route's target glob matches zero registered actions, Sails logs this warning including the route path prefix and the unmatched glob, so you know the route exists but will never resolve to an action at request time.

Source

Thrown at lib/app/private/controller/load-action-modules.js:239

          })) {
            return;
          }
        }
        // Otherwise, construct a warning using the _middlewareType properties (if available) of the middleware functions
        // that were mapped to this action glob.
        var warning = 'Action middleware ';
        warning += (function(){
          var fnDescs = _.reduce(fns, function(memo, fn) {
            if (fn._middlewareType) { memo.push(fn._middlewareType); }
            return memo;
          }, []);
          if (fnDescs.length) {
            return '(' + fnDescs.join(', ') + ') ';
          }
          return '';
        })();//†
        warning += 'was bound to a target `' + actionGlob + '` that doesn\'t match any registered actions.';
        sails.log.warn(warning);
        raisedWarnings = true;
      });//∞
    });//∞

    // If we raised any warnings, add an extra line break afterwards.
    if (raisedWarnings) {
      console.log();
    }

    // All done.
    return cb();

  }); // </includeAll>

};

View on GitHub (pinned to 7b76422cc2)

Solutions

  1. Fix the glob in config/routes.js to the correct action identity (check sails get-actions / registered actions).
  2. Ensure the target action file exists with a valid name so it actually loads and registers.
  3. Remove the dead route if the action was intentionally deleted.

Example fix

// before (config/routes.js)
'GET /users': 'UsersController.find'   // controller is actually named UserController
// after
'GET /users': 'UserController.find'
Defensive patterns

Strategy: validation

Validate before calling

// Verify every route target resolves before lift:
for (const [addr, target] of Object.entries(sails.config.routes)) {
  const glob = typeof target === 'string' ? target.split(' ')[0] : null;
  if (glob && !sails.hooks.actions.registeredActions().some(a => micromatch.isMatch(a.identity, glob))) {
    console.warn(`Route ${addr} target glob '${glob}' matches no registered action`);
  }
}

Prevention

When it happens

Trigger: A route in config/routes.js binds to an action glob such as 'some/folder/*' or 'UserController.*' while no registered action matches — due to a typo, the action file never loaded (e.g. ignored as garbage), or the controller was renamed/refactored.

Common situations: Renaming actions or controllers without updating config/routes.js, typos in route targets, actions ignored by the filename-convention loader, or relying on actions that were removed during an upgrade (e.g. Sails 0.12 to 1.x migration).

Related errors


AI-assisted analysis of balderdashy/sails@7b76422cc2 (2026-09-01). Data as JSON: /api/errors/1b6a8f0458fe0f04. Report an issue: GitHub.