balderdashy/sails · error

Usage: If provided, `namespace` should be a string

Error message

Usage: If provided, `namespace` should be a string

What it means

Error "Usage: If provided, `namespace` should be a string" thrown in balderdashy/sails.

Source

Thrown at lib/hooks/views/html-scriptify.js:101

        throw new Error('Usage: If provided, `keys` should be an array of strings');
      } else { throw e; }
    }
  }//--•
  else {
    // (if unspecified, we leave `options.keys` as `undefined`)
  }//>-

  // Verify `namespace`, if provided (or use default)
  //
  // > Note that while we might also consider validating `namespace` as an
  // > ecmascript-compatible variable name, in the interest of avoiding any
  // > more dependencies here, we do not.
  if (!_.isUndefined(options.namespace)) {
    try {
      options.namespace = rttc.validate('string', options.namespace);
    } catch (e) {
      if (e.code === 'E_INVALID') {
        throw new Error('Usage: If provided, `namespace` should be a string');
      } else { throw e; }
    }
  }
  else {
    options.namespace = 'SAILS_LOCALS';
  }//>-

  // Verify `dontUnescapeOnClient` flag, if provided (or use default)
  //
  // > If special backwards-compatible support for older browsers is needed, or any
  // > other customizations to the client-side escaping code are necessary, then
  // > the built-in client-side escaping can be disabled using `dontUnescapeOnClient: true`.
  if (!_.isUndefined(options.dontUnescapeOnClient)) {
    try {
      options.dontUnescapeOnClient = rttc.validate('boolean', options.dontUnescapeOnClient);
    } catch (e) {
      if (e.code === 'E_INVALID') { throw new Error('Usage: If provided, `dontUnescapeOnClient` should be either `true` or `false`'); }
      else { throw e; }

View on GitHub (pinned to 7b76422cc2)

When it happens

Trigger: Thrown at lib/hooks/views/html-scriptify.js:101 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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