Kong/insomnia · error · Error

no module is found for "${moduleName}"

Error message

no module is found for "${moduleName}"

What it means

Error "no module is found for "${moduleName}"" thrown in Kong/insomnia.

Source

Thrown at packages/insomnia-testing/src/run/run.ts:43

        'util',
        'url',
        'punycode',
        'querystring',
        'string_decoder',
        'stream',
        'timers',
        'events',
        // follows should be npm modules
        // but they are moved to here to avoid introducing additional dependencies
      ].includes(moduleName)
    ) {
      return require(moduleName);
    } else if (['atob', 'btoa'].includes(moduleName)) {
      return moduleName === 'atob' ? atob : btoa;
    } else if (externalModules.has(moduleName)) {
      const externalModule = externalModules.get(moduleName);
      if (!externalModule) {
        throw Error(\`no module is found for "$\{moduleName}"\`);
      }
      return externalModule;
    }
  
    throw Error(\`no module is found for "$\{moduleName}"\`);
  };

  require = requireInterceptor;
  `;

  // Ensure that the require is at the top of the file
  return `${injectScript}\n${source}`;
}

// declare var insomnia: Insomnia;
const runInternal = async <TReturn, TNetworkResponse>(
  testSrc: string | string[],
  options: InsomniaOptions<TNetworkResponse>,

View on GitHub (pinned to d9bb2b0142)

When it happens

Trigger: Thrown at packages/insomnia-testing/src/run/run.ts:43 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Kong/insomnia@d9bb2b0142 (2026-08-26). Data as JSON: /api/errors/684ec6021f0a43fb. Report an issue: GitHub.