meteor/meteor · error · Error

globPatterns must be a non-empty array

Error message

globPatterns must be a non-empty array

What it means

Error "globPatterns must be a non-empty array" thrown in meteor/meteor.

Source

Thrown at npm-packages/meteor-rspack/lib/ignore.js:94

      pattern = '!' + pattern;
    }

    globPatterns.push(pattern);
  });

  return globPatterns;
}

/**
 * Creates a regex pattern to match the specified glob patterns.
 * Converts glob patterns with * and ** into regex equivalents.
 * 
 * @param {string[]} globPatterns - Array of glob patterns from createIgnoreGlobConfig
 * @returns {RegExp} - Regex pattern to match the specified patterns
 */
function createIgnoreRegex(globPatterns) {
  if (!Array.isArray(globPatterns) || globPatterns.length === 0) {
    throw new Error('globPatterns must be a non-empty array');
  }

  // Process each glob pattern and convert to regex
  const regexPatterns = globPatterns.map(pattern => {
    // Skip negation patterns for the regex
    if (pattern.startsWith('!')) {
      return null;
    }

    // Escape special regex characters, but not * and /
    let regexPattern = pattern.replace(/[.+?^${}()|[\]\\]/g, '\\$&');

    // Use a temporary placeholder for ** that won't be affected by the * replacement
    // This is necessary because if we directly replace ** with .* and then replace * with [^/]*
    const DOUBLE_ASTERISK_PLACEHOLDER = '__DOUBLE_ASTERISK__';
    regexPattern = regexPattern.replace(/\*\*/g, DOUBLE_ASTERISK_PLACEHOLDER);

    // Convert * to regex equivalent (any number of characters except /)

View on GitHub (pinned to 5076d2f818)

Solutions

  1. Provide a non-empty array of glob patterns.
  2. Remove the globPatterns option entirely if you do not need custom ignore patterns.

When it happens

Trigger: Thrown when globPatterns is missing, not an array, or an empty array.

Common situations: Calling the ignore helper without providing at least one glob pattern to match files.


AI-assisted analysis of meteor/meteor@5076d2f818 (2026-08-13). Data as JSON: /api/errors/51378ce6017b4c6e. Report an issue: GitHub.