references/javascript/verification-troubleshooting.md
references/javascript/verification-troubleshooting.mdBrowse 15 files
653 tokens
2,853 bytes
Token encoding: o200k_base
Snapshot 39d1eb4
← Back to SKILL.md
JavaScript / TypeScript Verification And Troubleshooting
Run the project's normal checks and at least one runtime smoke path after instrumentation.
Static Checks
- Run the package's typecheck, build, lint, or test script when present.
- For monorepos, run checks for the modified workspace.
- Ensure imports match module format: ESM uses
import, CommonJS usesrequire. - Search client code and public env files for leaked write-token names or values.
Useful searches:
rg "LOGFIRE_TOKEN|NEXT_PUBLIC_.*LOGFIRE|VITE_.*LOGFIRE|Authorization=.*logfire|Authorization=.*pylf"
rg "@pydantic/logfire-node" src app pages
The second search should not find browser-only modules.
Runtime Smoke Tests
Node:
- Set
LOGFIRE_CONSOLE=trueand a token orLOGFIRE_SEND_TO_LOGFIRE=false. - Start through the instrumented script.
- Trigger one request or job.
- Confirm local console output or Logfire traces.
Next.js:
- Confirm
instrumentation.tsis in root orsrc. - Start the app with OTLP env vars set.
- Load a server-rendered route or call a route handler.
- If browser tracing was added, inspect network requests to the
/v1/tracesURL derived from the regionalbaseUrl, or to the existing proxy URL when the app deliberately uses one.
Cloudflare:
- Run the existing Wrangler dev script.
- Trigger a Worker request.
- Confirm
.dev.varshasLOGFIRE_TOKENlocally and production useswrangler secret.
Deno:
- Run with
OTEL_DENO=trueand--unstable-otel. - Trigger a manual span or request path.
Common Missing-Trace Causes
- Node instrumentation file is imported after Express, HTTP clients, database clients, or the app entrypoint.
- The start script was changed for
devbut production uses a different uninstrumented script. - The app is ESM but the preload was added as
--requireinstead of--import. LOGFIRE_TOKENis absent and local.logfirecredentials are not configured.- Browser code is using an ordinary write token instead of the restricted frontend application token, or its regional base URL and token came from different applications or regions.
- Next.js has
instrumentation.tsin the wrong directory for the app structure. - Vercel AI SDK 7 has no registered
@ai-sdk/otelintegration, or an AI SDK 5/6 call is missingexperimental_telemetry: { isEnabled: true }. - Existing OpenTelemetry configuration exports to a different backend or creates a competing tracer provider.
What To Report Back
Summarize:
- detected JS/TS runtimes and frameworks
- packages installed per workspace
- files changed for instrumentation and startup
- environment variables or secrets the user must set
- verification commands run and whether traces/log output were observed
- any unverified runtime path, especially production-only scripts or browser runtime configuration