Troubleshooting
Common issues when profiling a NestJS app - no profiles appear, empty Logs tab, GraphQL not captured, missing collector panels, 401 on the UI - and how to fix each one.
This page collects the symptoms people hit most often and the fix for each. If none of these match, open the raw profile JSON at /_profiler/{token}/data to see exactly what was captured.
ERR_REQUIRE_ESM on NestJS 12
The app crashes on startup with Error [ERR_REQUIRE_ESM]: require() of ES Module …/@nestjs/common/index.js from …/@eleven-labs/nest-profiler/dist/….js not supported.
NestJS 12 ships its packages as ESM and keeps supporting CommonJS applications, which load them through Node's require() of ES modules. A CommonJS application loads the profiler's CommonJS build, which loads NestJS the same way; an ESM application imports the profiler's ESM build, which never does. Node.js only allows require() of ES modules by default from 22.12 on.
- Node.js 22.0 to 22.11. Upgrade to 22.12 or newer, the minimum NestJS 12 itself requires on the 22.x line.
require()of ES modules disabled. Some runtimes turn it off whatever the Node.js version, such as AWS Lambda on its Node.js 20, 22 and 24 runtimes. Turn it back on withNODE_OPTIONS=--experimental-require-module, as the NestJS migration guide recommends: a CommonJS NestJS 12 application needs it there anyway.
No profiles appear at all
The list at /_profiler stays empty even after making requests.
- The app booted without the profiler. With the dev-dependency install, only the dev entrypoint loads it: start the app with
main-dev.ts(nest start --entryFile main-dev -p tsconfig.dev.json), notmain.tsornode dist/main. With the runtime gate, the activeProfilerModuleis only loaded whenisProfilerEnabledis true (e.g.PROFILER_ENABLED=true) — check the environment the app actually booted with. - The path is ignored. Requests matching
ignorePathsor the built-in defaults (favicon, robots.txt, the Chrome DevTools probe, apple-touch-icon) are skipped. SetuseDefaultIgnorePaths: falseto profile those too, or verify yourignorePaths/ignoreRequestpredicate isn't matching your route. - Sampling is on. A
sampleRatebelow1.0profiles only a fraction of requests. Set it to1.0while debugging. - In-memory storage was cleared. The default
memorybackend is emptied on every restart. UsestorageType: 'file'(or the SQLite adapter) to keep profiles across restarts. See Storage backends.
The Logs tab is empty
Logs are written to the console but never show up in the profile.
- Wrap the logger in the entrypoint that loads the profiler (
main-dev.tswith the dev-dependency install):app.useLogger(createProfilerLogger(new ConsoleLogger()))(importcreateProfilerLoggerfrom@eleven-labs/nest-profiler), and create the app with{ bufferLogs: true }. See Set up the profiler. app.useLogger()only captures logs that flow through NestJS'sLogger: in services, usenew Logger(MyService.name)rather than aConsoleLoggerinstance. A logger injected directly into a service (e.g.nestjs-pino'sPinoLogger) must be wrapped explicitly — through an optionalLOGGER_WRAPtoken filled by the dev bundle, or withcreateProfilerLogger(...)at the injection point under the runtime gate. See Log capture.- A CLI (
nest-commander) app passes the wrapped logger toCommandFactory.run(CliDevModule, { logger: createProfilerLogger(...) }).
GraphQL operations are not profiled
REST requests appear but GraphQL operations don't.
- The GraphQL package is missing. The core
ProfilerModuleis HTTP-only. Install and register@eleven-labs/nest-profiler-graphql. - The
contextfactory is missing. The profiler needs access to the underlying HTTP request. Configurecontext: ({ req }) => ({ req })(Apollo / graphql-yoga) orcontext: ({ request }) => ({ request })(Mercurius usesrequest, notreq). Without it the profiler silently falls back to passthrough. - Subscriptions. WebSocket-transport subscriptions are not profiled at this time.
See GraphQL support.
A collector is installed but its panel is missing
The package is added but no tab shows up in the UI.
- The collector isn't loaded. Each collector must be imported in the feature module it instruments and gated with the same
isProfilerEnabledpredicate. If profiling is off, it isn't loaded. - Wrong placement. Infra-scoped collectors (database, HTTP client, cache, messaging, GraphQL transport) must sit next to the
HttpModule/ ORM / broker they instrument - they cannot join a root-levelProfilingModulebundle. See Configuration. - Nothing was captured. A panel only renders when the collector recorded at least one entry during the request. Exercise the code it instruments (run a query, hit the cache, consume a message).
Database queries are missing
The Database (or MongoDB) tab is empty for a request that clearly hit the database.
- Queries executed outside a request context - during module initialization, in a scheduled job with no active profile, or before the middleware ran - are silently ignored because there is no active CLS profile to append to. Only queries triggered within a profiled request are captured.
/_profiler returns 401 Unauthorized
Access to the UI is protected.
- A
securitystrategy (authorizepredicate and/orguards) is configured and denied the request. Send the credential it expects (e.g.Authorization: Bearer <token>, a session cookie, or Basic auth), or remove thesecurityoption for local development. See Securing the UI.
A nest-commander command exits immediately and prints nothing
After installing the profiler, a CLI command logs Starting Nest application... (or nothing at all) and the process exits 0 without ever running — no result, no error.
- The CLI root module doesn't import
ConfigModule.forRoot()(runtime gate only — a dev-dependency install has no gate).ConditionalModule.registerWhenawaitsConfigModule.envVariablesLoadedfrom@nestjs/config, and that promise only resolves once@nestjs/config'sConfigModule.forRoot()has run. A CLI bootstrapped withCommandFactorywhose root module never imports it never resolves the promise, so registration hangs — and because the internal 5s timeout timer isunref'd, the event loop just drains and the process exits0silently instead of throwing. Fix: importConfigModule.forRoot()from@nestjs/configin your CLI root module. This applies to every module the CLI loads that gates something withregisterWhen(core, database, RabbitMQ collectors…). HTTP apps rarely hit this because their root module already importsConfigModule.forRoot(). See Command profiling and Enabling and disabling the profiler.
CLI command profiles don't appear next to HTTP requests
You profiled a nest-commander command but can't find it in the web UI.
- The CLI process and the HTTP app are separate processes with separate in-memory stores. Use file (or SQLite) storage with the same
storagePathfor both, so the command runs written by the CLI show up at/_profilernext to the HTTP profiles. See Command profiling and the example app. - The command failed while commander parsed the argv, and commander exited the process itself. An unknown option, a missing required option, an invalid
choicesvalue, or an@Option()parser throwing commander'sInvalidArgumentErrorall end in commander printing a CLI error and callingprocess.exit()— nothing is left running to persist a profile. An option parser that throws a plainErroris profiled (failed, with the raw value of the rejected flag). See Command profiling.
Getting started
Install and configure @eleven-labs/nest-profiler in a NestJS 11 or 12 app - set up the core module, enable collectors, and open the /_profiler UI in minutes.
Agent skills
Install and configure @eleven-labs/nest-profiler with your coding agent — npx skills teaches Claude Code, Cursor, Codex and others to wire the profiler and the collectors that match your stack.