nitro

작성자: sentry

Nitro v3를 사용하여 범용 JavaScript 서버를 구축하고 배포합니다. nitro.config.ts, defineNitroConfig, defineHandler, defineConfig, server.ts… 작업 시 사용하세요.

npx skills add https://github.com/getsentry/junior --skill nitro

Build, configure, and deploy Nitro v3 applications using correct APIs and patterns.

Step 1: Classify the request

Request typeRead first
API surface, handler signatures, imports, config optionsreferences/api-surface.md
Setup, routing, caching, storage, plugins, frameworks, common patternsreferences/common-use-cases.md
Build failures, runtime errors, deployment issues, migration from v2references/troubleshooting-workarounds.md

Load only the reference(s) matching the request. If the task spans categories, load relevant files.

Step 2: Apply core guardrails

  1. Import defineHandler from "nitro", not defineEventHandler (v2 API).
  2. Import config helpers from subpaths: "nitro/config", "nitro/cache", "nitro/storage", "nitro/database", "nitro/runtime-config", "nitro/types".
  3. Use web standard event.req (Request) for body/headers — not v2 utilities like readBody or getHeader.
  4. Never return from middleware unless intentionally terminating the request.
  5. Only GET/HEAD requests are cached by defineCachedHandler; other methods bypass automatically.
  6. useDatabase and defineTask require experimental feature flags.
  7. Use "nitro" package name, not "nitropack" (v2).

Step 3: Implement

  1. For new projects, use defineConfig from "nitro" in nitro.config.ts or add nitro() plugin from "nitro/vite" to vite.config.ts.
  2. For server entry, export a web-compatible fetch(Request): Response handler from server.ts, or use server.node.ts for Express/Fastify.
  3. For filesystem routes, place handlers in routes/ or api/ with [param] for dynamic segments and .get.ts/.post.ts for method-specific routes.
  4. For caching, use defineCachedHandler from "nitro/cache" with maxAge and swr options.
  5. For storage, use useStorage(namespace) from "nitro/storage" and configure drivers via storage config.
  6. For plugins, create files in plugins/ directory using definePlugin and hook into request, response, error, or close.
  7. For deployment, set preset in config or use NITRO_PRESET env var; Vercel/Netlify/Cloudflare are auto-detected.

Step 4: Validate

  1. Run nitro dev and verify routes respond correctly.
  2. Run nitro build and check .output/server/ contains expected files.
  3. For cached routes, verify cache headers (etag, cache-control) and 304 responses.
  4. For storage, verify data persists across requests with configured driver.
  5. For deployment, verify the preset produces correct output format.

Step 5: Troubleshoot

  1. defineEventHandler is not defined → use defineHandler from "nitro" (v3 API).
  2. Cannot find module 'nitropack' → rename to "nitro" in imports and package.json.
  3. Route not matched → check file is in routes/ or api/, or verify routes config mapping.
  4. Middleware returning responses unexpectedly → ensure middleware does not return a value.
  5. For detailed diagnostics, read references/troubleshooting-workarounds.md.

sentry의 다른 스킬

generate-frontend-forms
sentry
Sentry의 새로운 폼 시스템을 사용하여 폼을 생성하는 가이드입니다. 폼, 폼 필드, 유효성 검사 또는 자동 저장 기능을 구현할 때 사용하세요.
official
sentry-snapshots-cocoa
sentry
Apple/Cocoa 프로젝트를 위한 전체 Sentry Snapshots 설정입니다. "SnapshotPreviews 설정", "Apple 스냅샷 테스트 설정", "Apple 스냅샷 업로드" 요청 시 사용하세요.
official
architecture-review
sentry
직원 수준의 코드베이스 건강 검토. 모놀리식 모듈, 무음 실패, 타입 안전성 격차, 테스트 커버리지 구멍, LLM 친화성 문제를 찾습니다.
official
linear-type-labeler
sentry
Linear 이슈를 분류하고, 각 이슈의 제목과 설명 내용을 기반으로 Sentry 워크스페이스의 레이블 분류 체계에서 Type 레이블을 적용합니다.
official
sentry-flutter-sdk
sentry
Flutter 및 Dart를 위한 완전한 Sentry SDK 설정입니다. "Flutter에 Sentry 추가", "sentry_flutter 설치", "Dart에서 Sentry 설정" 또는 오류 구성을 요청받았을 때 사용하세요.
official
sentry-svelte-sdk
sentry
Svelte 및 SvelteKit을 위한 완전한 Sentry SDK 설정입니다. "Svelte에 Sentry 추가", "SvelteKit에 Sentry 추가", "@sentry/sveltekit 설치" 또는 구성 요청 시 사용하세요.
official
vercel-react-best-practices
sentry
Vercel Engineering의 React 및 Next.js 성능 최적화 가이드라인입니다. 이 스킬은 React/Next.js 코드를 작성, 검토 또는 리팩토링할 때 사용해야 합니다.
official
sentry-tanstack-start-sdk
sentry
TanStack Start React용 전체 Sentry SDK 설정. "TanStack Start에 Sentry 추가", "@sentry/tanstackstart-react 설치" 또는 오류 구성 요청 시 사용…
official