nitropack
2.13.6 · 2 Nov 2026MIT3.9M / weekRepositoryHomepagenpmAtom feed
134 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
2.13.6
2 Nov 2026- Security
GHSA-39r7-wfcx-99xg: Cached event handlers might share entries across HTTP methods or replay per-user
Set-Cookieheaders - Security
GHSA-rhhp-7488-3qwf: Proxy route rule scope bypass via empty
//segment and prefix re-entry - Security
GHSA-pqxc-r4h5-jc95: Open redirect via backslash and control characters in wildcard
redirectroute rules
Security
This release contains 3 security fixes and additional hardening for cache, proxy and redirect route rules. If you're on nitropack v2 (including Nuxt 3 and 4), please upgrade.
- Security
GHSA-39r7-wfcx-99xg: Cached event handlers might share entries across HTTP methods or replay per-user
Set-Cookieheaders - Security
GHSA-rhhp-7488-3qwf: Proxy route rule scope bypass via empty
//segment and prefix re-entry - Security
GHSA-pqxc-r4h5-jc95: Open redirect via backslash and control characters in wildcard
redirectroute rules
Performance
externals: Memoize tryResolve per importer directory in node-externals (v2)
Fixes
Add typeFrom support for
autoimports exports generationcache: Only cache
GET/HEADand never store per-user responsesroute-rules: Validate final proxy/redirect target scope
- Security
route-rules: Prevent open redirect via backslash and control characters in wildcard redirects
Preset Changes
vercel: Support node.js 26
2.13.5
19 Oct 2026aws-amplify: Support node.js 22 and 24 runtimes
cloudflare: Prefer source path rather than #imports
vercel: Add framework info to build output config
Preset Changes
aws-amplify: Support node.js 22 and 24 runtimes
cloudflare: Prefer source path rather than #imports
vercel: Add framework info to build output config
vercel: Add support for node@24 (v2)
Fixes
types: Only strip extensions that ts retries
types: Emit auto-import paths as files, not directories
Respect h3 url in swr handler
Preserve sourcemap mappings for chunks containing user code
build: Count each output file once in the size report
vercel: Mark header-only route entries as continue
cloudflare: Guard nodejs_compat flag by compatibility date
cloudflare: Detect implicit nodejs_compat when deployConfig is false
cloudflare: Warn only about conflicting asset overrides
externals: Match string rules against windows ids
externals: Normalize resolved paths on windows
rollup: Keep import attributes in the build output
dev: Close upgraded sockets and resolve on worker shutdown timeout
openapi: Only filter undefined from array nodes
dev: Proxy websocket upgrades for devProxy routes with ws
vercel: Strip trailing slash from prerendered route overrides
vercel: Use SameSite=Lax for skew protection cookie
static: Respond with 404 when a public asset is missing on disk
bun: Support NITRO_BUN_IDLE_TIMEOUT=0
vercel: Enable ISR passQuery when allowQuery is set
prepare: Keep public assets inside output dir when cleaning
task: Support dev worker listening on a unix socket or named pipe
node, deno: Support PORT=0 for random port assignment
bun: Use hostname option for Bun.serve
prerender: Only refuse .. as a whole path segment
cloudflare: Fix baseURL traversal for wrangler assets dir
cloudflare: Use pathe for POSIX relative paths in wrangler.json (v2)
Types
Widen RollupConfig.plugins to accept rolldown-typed plugins
Add missing wrangler observability types
Performance
dev: Cache sourcemap consumer per bundle in error handler
2.13.4
29 Apr 2026- Security
route-rules: Prevent open redirect via protocol-relative url bypass
Add version meta
route-rules: Reject out-of-scope requests
Important
This release patches two medium-severity vulnerabilities in
proxyandredirectroute rules. Users relying on either are strongly encouraged to upgrade. See GHSA-5w89-w975-hf9q and GHSA-9phm-9p8f-hw5m for details.Enhancements
Add version meta
Fixes
route-rules: Reject out-of-scope requests
- Security
route-rules: Prevent open redirect via protocol-relative url bypass
2.13.3
2 Apr 20262.13.2
20 Mar 2026prerender: Skip writing routes with
..or outside of public dirprerender: Mark invalid routes as skipped
vercel: Add types and docs for
isr.exposeErrBody
Note
This release upgrades h3 to latest
1.15.9which contains security fixes.Fixes
prerender: Skip writing routes with
..or outside of public dirprerender: Mark invalid routes as skipped
Preset Changes
vercel: Add types and docs for
isr.exposeErrBody
2.13.1
15 Jan 2026- Security
h3@1.15.5released with security fix (release notes) unstorage@v1.17.4released withchokidar,lru-cache, andh3dependency bumps (release notes)
This release mainly updates dependencies
- Security
h3@1.15.5released with security fix (release notes) unstorage@v1.17.4released withchokidar,lru-cache, andh3dependency bumps (release notes)
2.13.0
8 Jan 2026vercel: Add support for skew protection
bun: Support
NITRO_BUN_IDLE_TIMEOUTenv variableProcess static assets in parallel
Enhancements
vercel: Add support for skew protection
bun: Support
NITRO_BUN_IDLE_TIMEOUTenv variable
Performance
Process static assets in parallel
Limit concurrency for compressing public assets
Fixes
firebase: Update gen 1 import to match latest sdk
Correct
cryptopolyfillvercel: Handle ISR requests with
passQuery: truedev: Automatically use
Content-Encoding: gzipfor.gzstatic filesstatic: Add vary: accept-encoding for assets with compressed version
dev: Respect
opts.jsonwhenfalsefor error handlerdev: Apply headers from route rules for static assets (c74d7a17, f059e4ba, be316b49)
vercel: Avoid adding o11y links for prerendered paths
cloudflare-durable: Expose env bindings in durable handler
Refactors
q
2.12.9
28 Oct 2025Set explicit delimiters to allow $ in replacements
vercel: Support bun runtime
Fixes
Set explicit delimiters to allow $ in replacements
Enhancenments
vercel: Support bun runtime
2.12.8
23 Oct 2025build: Avoid replacing
window$1cloudflare: Add
cloudflare:workersalias in devSupport autoimports
typeFromproperty for declaration gen
Fixes
build: Avoid replacing
window$1cloudflare: Add
cloudflare:workersalias in devSupport autoimports
typeFromproperty for declaration gen
2.12.7
7 Oct 2025vercel: Always add
urlto src regex forisrroutes
2.12.6
11 Sep 2025vercel: Generate prerender config for o11y routes matching
isrroute rulevercel: Skip o11y routes matching
isrroute rule
Fixes
2.12.5
2 Sep 2025- Deprecated
Deprecate
edgiopreset vercel: Prefix o11y routes with
baseURLAllow accessing VFS through unix sockets
Fixes
vercel: Prefix o11y routes with
baseURLAllow accessing VFS through unix sockets
cloudflare-module: Output
_headersfile to the correct directorybun: Respect
HOSTandNITRO_HOST
Documentation
- Deprecated
Deprecate
edgiopreset
2.12.4
22 Jul 2025vercel: Valid regex for o11y routes
2.12.3
17 Jul 2025config: Fallback to
nitro-devfor older compatibility datesStore
nitro.jsoncommands relative to output dircloudflare: Lowercase auto generated worker name
Fixes
config: Fallback to
nitro-devfor older compatibility datesStore
nitro.jsoncommands relative to output dircloudflare: Lowercase auto generated worker name
2.12.2
16 Jul 2025cloudflare, aws-lambda: Optional access to options
2.12.1
16 Jul 2025build: Resolve
deployandpreviewcommands
2.12.0
15 Jul 2025Dev presets
Enhancements
Dev presets
vercel: Observability route hints [docs] (#3474, 644cbe07, e2dc6385, 128c517b)
aws-amplify: Support and default to node.js
20.xruntimessrRoutes
Fixes
Respect output configs for preview/deploy command tips
cloudflare-module: Generate
_headersin distazure: Prefer
bodyBufferfor request bodycloudflare: Fix tips for the preview/deploy commands
vercel: Clamp runtime config to valid node versions
2.11.13
25 Jun 2025types: Resolve absolute paths for type imports
cloudflare: Global
process.envpolyfilldev: Only use build dir for output
Fixes
types: Resolve absolute paths for type imports
cloudflare: Global
process.envpolyfilldev: Only use build dir for output
types: Enable
skipLibCheckby defaultexaternals: Add an option to change output
node_modulespermission
2.11.12
13 May 2025dynamic-require: Update regexp for new webpack import pattern
aws-lambda-streaming: Handle undefined response body
Scan handlers when initialising nitro
Fixes
dynamic-require: Update regexp for new webpack import pattern
aws-lambda-streaming: Handle undefined response body
Scan handlers when initialising nitro
2.11.11
28 Apr 2025static: Remove id from 404
statusMessage
2.11.10
27 Apr 2025open-api: Load virtual files from rollup rather than fs
netlify-edge: Enable function caching
cloudflare: Inherit
context._platformfor direct fetch
Fixes
open-api: Load virtual files from rollup rather than fs
netlify-edge: Enable function caching
cloudflare: Inherit
context._platformfor direct fetch
2.11.8
26 Mar 2025dev: Conditionally set headers for error handler
aws-lambda: Aws-lambda-streaming set-cookie headers
config: Resolve
srcDirrelative torootDir
Fixes
dev: Conditionally set headers for error handler
aws-lambda: Aws-lambda-streaming set-cookie headers
config: Resolve
srcDirrelative torootDir
2.11.7
18 Mar 2025cloudflare: Update node.js compatibility (
node:cryptoandnode:tls)netlify-edge: Update node.js compatibility (
node:sqlite)
Updates
cloudflare: Update node.js compatibility (
node:cryptoandnode:tls)netlify-edge: Update node.js compatibility (
node:sqlite)Minor dependency updates and removed unused dependencies (c24f39c2, ff9c4f08)
Fixes
app: Import user code last to avoid initialization order issues
app: Only inherit
waitUntiland platform context in direct fetchdev: Always propagate proxy errors
2.11.5
7 Mar 2025dev: Use abstract sockets on linux with node.js >=20
dev: Use os tmp dir for unix sockets
Mark
$globaloptional forNitroRouteMeta
Fixes
dev: Use abstract sockets on linux with node.js >=20
dev: Use os tmp dir for unix sockets
Types
Mark
$globaloptional forNitroRouteMeta
2.11.4
7 Mar 2025dev: Auto fallback to port if socket listening failed
dev: Try normal socket for CI
Fixes
2.11.3
6 Mar 2025cloudflare: Support
wrangler.jsoncExpose default error to custom handler
Only show force close warn in debug mode
cloudflare: Support
wrangler.jsoncExpose default error to custom handler
Only show force close warn in debug mode
2.11.2
5 Mar 2025prerender: Ignore prefixed public assets
dev: Force close server immediately in test and ci
Fixes
2.11.1
5 Mar 2025dev: Use full socket path for windows and linux
dev: Add random number to socket name
dev: Limit
/_vfsto local ips only
Fixes
dev: Use full socket path for windows and linux
dev: Add random number to socket name
dev: Limit
/_vfsto local ips onlyapp: Update
eventbefore callingrequesthook
2.11.0
4 Mar 2025deno-deploy and netlify-edge: Automatically enabled after upgrade for all Node.js APIs (#3129).
deno-server: Upgrade to Deno v2 and set
compatibilityDateto2025-01-30or later (#3050).vercel-edge (deprecated): Automatically enabled after upgrade for a subset of Node.js APIs (#3136).
What is new?
Better Errors
Error handlers for both development and production environments have been rewritten (see #3002 for more details).
Powered by poppinss/youch (v4.x), you can now view beautiful error pages with stack traces in both the browser and CLI.
Nitro automatically applies source maps to error stack traces—no need to setNODE_OPTIONS="--enable-source-maps"—allowing you to pinpoint the exact file and line where an issue occurs.Previously, Nitro conditionally rendered JSON errors based on certain
user-agentheaders or when requests were made to/api/*.
For more consistent behavior, any request not made from a browser (i.e., without theAccept: text/htmlheader) will always receive a JSON response. Additionally, all production errors are now returned in JSON format.You can still override the error handler for both development and production using the
errorHandlerconfig. If you want to fall back to the default error handler conditionally, you can simplyreturnwithout handling the response (see #3085 for more details).Additional strict security headers will be always added to error responses (#2907).
Example error in development:
Example error in production
{ "error": true, "url": "http://localhost:3000/", "statusCode": 500, "statusMessage": "Server Error", "message": "Server Error", "data": { "foo": "bar" } }Better Dev Server
Every time you run the
nitro devornuxt devcommand, Nitro creates an isolated worker thread and proxies requests from the browser to the server inside the worker using a Unix socket or a named pipe on Windows.To improve stability and provide a better experience, the internal mechanism for creating and reloading the server and handling errors has been rewritten (see #3135 for more details).
Database Improvements
Nitro's database support, powered by db0 0.3.x, now offers improved types, better-prepared statements, better API consistency, and native
node:sqlitesupport (#3127).Thanks to native node:sqlite support in Node.js (>= 22.5.0) and Deno (>= 2.2), you can now use databases in both environments without external dependencies or extra configuration!
Improved
baseURLHandlingFor deployments that need to be served under a base URL (e.g.,
/admin), Nitro provides abaseURLconfig. When enabled, all routes and static assets will be prefixed accordingly.Depending on the deployment platform, the build output structure may need to be adjusted. The Netlify and Stormkit presets have been updated with fixes (#2966, #2971, 5a51bf06). Additionally, we have enabled
baseURLfor nitro-deploys for end-to-end testing.The new Nitro error handler also improves the user experience. If a request is made to the server without the required base URL, it will now automatically redirect (#3146).
Prerender Crawler
Nitro's prerender feature includes a crawler that scans each page to discover additional links. However, previous versions relied on regex matches, which occasionally led to false detections.
This release migrates to natemoo-re/ultrahtml for more precise link extraction (#3068).
Improved Module Resolution
Nitro has migrated to exsolve for internal module resolution. This change improves performance (up to 3x), and stability, and enforces stricter search paths (#3125).
Firebase App Hosting
Zero-config deployment support for Firebase App Hosting has been added (#2864, #2895, #2967).
Node.js Compatibility for edge and Deno v2
The Nitro server can be deployed to any runtime and platform. We built unenv and integrated it into Nitro so that if your code or any library you use requires Node.js-specific features such as Buffer, process.env, or setImmediate, they can continue working through automatically injected lightweight polyfills.
Thanks to efforts like WinterCG, the ecosystem has shifted towards using more web standards that work in any JavaScript runtime.
However, some Node.js features remain difficult to replace, such as node:async_hooks, node:crypto, node:net, and evenprocess.env, which plays a de facto standard role while standards for JavaScript servers continue to evolve.Edge runtimes (Cloudflare Workers, Deno Deploy, Netlify Edge, and Vercel Edge) are built on top of the V8 engine and traditionally lacked support for Node.js APIs and globals. Thankfully, both Deno (v2) and Cloudflare (workerd) have made significant efforts to support Node.js APIs in their edge runtimes. You can check the status using the unofficial platform-node-compat tests.
This improvement makes Nitro's support for edge runtimes faster, smaller, and more capable. Features like AsyncLocalStorage, which cannot be simply polyfilled, benefit from these new APIs.While edge platforms have (partially) implemented Node.js APIs, we still need to polyfill any unsupported features using unenv.
Unenv v2 is a major rework with all Node.js modules rewritten as ESM polyfill modules, ensuring full coverage of known exports from the latest Node.js LTS release. With Unenv v2, we can create hybrid/native Node.js polyfills that combine native runtime support with polyfills at the module export level (used for cloudflare presets).Enabling Node.js compatibility:
deno-deploy and netlify-edge: Automatically enabled after upgrade for all Node.js APIs (#3129).
deno-server: Upgrade to Deno v2 and set
compatibilityDateto2025-01-30or later (#3050).vercel-edge (deprecated): Automatically enabled after upgrade for a subset of Node.js APIs (#3136).
cloudflare: Add
nodejs_compatto your wrangler configuration.nuxt-hub: Automatically enabled after upgrading dependencies.
For Cloudflare deployments, we have also added an experimental new method to enable Node.js compatibility, which will be enabled by default in future releases.
Please note that creating awrangler.tomlfile or usingdeployConfigflag, disables Cloudflare dashboard features, and variables set from the dashboard will be lost.Opt-in to cloudflare deploy config
// Nitro export default defineNitroConfig({ compatibilityDate: "2025-03-01", cloudflare: { nodeCompat: true, deployConfig: true } }); // Nuxt export default defineNuxtConfig({ compatibilityDate: "2025-03-01", nitro: { cloudflare: { nodeCompat: true, deployConfig: true } } });Dependency Upgrades
Several dependencies across unjs have been updated, focusing on performance improvements and an ESM-only dist to reduce install size. This has already reduced the package size by approximately
~28MB, with further reductions planned as we phase out dual-format published packages.unenv upgraded to v2 (full rewrite).
db0 upgraded to v0.3 (ESM-only, native
node:sql, improvements).ohash upgraded to v2 (#3114) (ESM-only, native
node:cryptosupport, much faster)unimport upgraded to v4 (improvements).
untyped upgraded to v2 (ESM-only, less install size).
c12 upgraded to v3 (ESM-only).
cookie-es upgraded to v2 (ESM-only).
esbuild upgraded to v0.25.
Other Changes
Note
164 commits, 168 files with 8,341 additions, and 5,476 deletions from 33 contributros since last 2.x release.
Changelog below is subset of changes (compare all changes)Enhancements
cloudflare-durable: Allow redirect
fetchto durable objectopenapi: Allow
$global.componentsindefineRouteMetaSupport
unenv:as array of presets in configAdd
build:beforehook
Fixes
Allow patching
globalThis.fetchUpdate
dynamic-requireplugin to match new webpack chunk formatUnique imports for
server-handlers-metaAuto import multiple levels of nested directories in
utils/Scan route files with other characters in param name
Add NitroApp type export to main subpath for backward compatibility
Run nitro modules before
createUnimportRespect configured
workspaceDirconfig: Use
staticpreset ifstatic: trueconfig is setconfig: Avoid serialization warning when primitives have prototype changed
config: Normalize route rules with leading slash
config: Clone preset object
config: Make sure serialized storage options are not modified
externals: Respect importer path for resolving
timing: Silent in test
server-assets: Include files without extension by default
rollup: Remove
unenv/npm/consolapolyfillrollup: Resolve unenv paths with expected version
cache: Polyfill
event.waitUntilforcachedEventHandlertypes: Deduplicate aliases
node-cluster: Create dedicated chunk for worker
azure-functions: Pass body to the context as-is
cloudflare: Add known
cloudflare:externalsnetlify: Avoid second bundling
deno-deploy: Always externalize
node:imports
Types
Fix type for
event.$fetch
2.10.4
8 Nov 2024raw: Avoid extra
this.resolvewhen possible
2.10.3
5 Nov 2024Allow adding custom
Varyto static assets handlernetlify: Only include env polyfill in
netlify-edgeScan env specific handlers without method in their name
Fixes
Allow adding custom
Varyto static assets handlernetlify: Only include env polyfill in
netlify-edgeScan env specific handlers without method in their name
config: Add back default storage mounts
Types
cache: Resolved value is not nullable
2.10.2
3 Nov 2024rollup: Pass options to
resolve
2.10.1
2 Nov 2024imports: Use explicit imports
imports: Use explicit import for
useDatabaserollup: Check raw extensions against resolved id
Fixes
imports: Use explicit imports
imports: Use explicit import for
useDatabaserollup: Check raw extensions against resolved id
presets: Update
node_clusterentry name
2.10.0
1 Nov 2024Current nitro-related repositories have been moved under the nitrojs Github org.
Nitro documentation is hosted under a new shorter domain name: nitro.build.
nitropacknpm package is in transition to becomenitro.
New home
After almost 4 years of Nitro development, it's time to evolve Nitro into a larger community and ecosystem.
Current nitro-related repositories have been moved under the nitrojs Github org.
Nitro documentation is hosted under a new shorter domain name: nitro.build.
nitropacknpm package is in transition to becomenitro.
We have created a new community. You can follow Nitro updates on X via @nitrojsdev and on Bluesky via @nitro.build and feel free to join our new Discord server if you like to be involved ❤️.
Major internal overhaul
We have made several (non-breaking) refactors in the Nitro codebase to improve long-term maintenance and structure consistency with the upcoming Nitro v3 releases.
Nitro 2.10 is a cumulative update with over 245 commits, 400+ changed files, 22,018 additions, and 13,207 deletions from 65 contributors, preparing for the next steps toward the Nitro 3 release. (see all changes)
src/*structure is more modular (#2473), all logic related to presets moved tosrc/presets/*(#2446) and internal type checks are more stricter (#2370, #2529).Important
If you previously imported any utility from
#internal/nitro/*ornitropack/runtime/*you should change them to#importsto avoid issues.Compatibility date
Deployment providers introduce new features that Nitro presets can leverage, but some of them need to be explicitly opted into.
Nitro introduces a new
compatibilityDateconfiguration (#2511) that allows leveraging the latest platform enhancements. The Cloudflare and Netlify presets now use this feature. If this configuration is not provided, Nitro will continue using the current (v2.9) behavior for presets.Migration:
export default defineNitroConfig({ +++ compatibilityDate: "2024-11-01", });Environment-specific handlers
Each route handler in
server/routes/*andserver/api/*is always included in the server bundle for development, prerender, and production.With the new environment-specific event handlers (#2272), you can now specify handlers that are included only under certain conditions:
.dev(e.g.,server/api/inspect.dev.ts): Included only in development mode..prerender(e.g.,server/api/og_image.prerender.ts): Included only in the prerendering stage..prod(e.g.,server/api/health.prod.ts): Included only in the production bundle.
This feature allows for conventionally having multiple versions of handlers (e.g.,
routes/admin.dev.ts+routes/admin.prod.ts).Additionally, if you add route handlers programmatically (via the
handlers:Nitro config), you can use theenvkey to specify preset-specific filters.Route groups
You can use
(...)/directory names insideserver/api/*andserver/routes/*to logically group handlers without dir being part of the path (#2664).For example, having
server/api/(group)/test.ts, will add a/api/testroute.production mode OpenAPI support
The experimental OpenAPI feature can now be enabled in production mode (#2570).
To enable it, set
openAPI.productionin the Nitro configuration.export default defineNitroConfig({ experimental: { openAPI: true, }, openAPI: { // IMPORTANT: make sure to protect OpenAPI routes if necessary! production: "runtime", // or 'prerender' }, });New OpenAPI routes:
/_openapi.json: OpenAPI v2 JSON to be used in external tools/_swagger: built-in Swagger UI/_scalar: built-in Scalar UI
Upgraded dependencies
Experimental WebSocket support is better with crossws@0.3 upgrade.
Experimental Database support is better with db0@0.2 upgrade.
Typescript support for
nitro.config.tsand nitro modules is better with jiti@2.0.
Preset updates
Cloudflare
cloudflare-modulepreset, withcompatibilityDateconfig set to2024-09-19or later, leverages new Static Assets support to allow serving static assets directly from cloudflare CDN with low latency and without hitting the worker and occurring costs (#2800) (Note: Please beware of current limitations while this feature is in Beta).A new (experimental)
cloudflare-durablepreset is available which extendscoudflare-moduleto allow leveraging Cloudflare Durable objects(#2801). This allows using WebSockets with pub/sub support for use cases like chat rooms or live collaboration (check out nuxt-tiptap for a demo).Nitro 2.10 added several hooks such as
cloudflare:emailandcloudflare:queue(#2487) andcloudflare:scheduled,cloudflare:email,cloudflare:queue,cloudflare:tailandcloudflare:traceforcloudflare-modulepreset (#2795) usable with plugins.With the
cloudflare-pagespreset, ifcloudflare: { wrangler: { ... } }is set in nitro config, Nitro will automatically merge it withwrangler.tomlin your project root during build.Netlify
netlifypreset uses Netlify Functions 2.0 format whencompatibilityDateis set to2024-05-07or later (#2406). This allows streaming responses (demo), better support for hybrid rendering (prerender: trueroute rule works as intended), improves background request generation, fixing bugs withset-cookie: undefinedon responses and Netlify Blobs will now work out of the box.Previously, ISR in Nitro had been implemented on Netlify via proprietary On-Demand Builders platform primitive, which only supported "v1" Functions. Now that there's momentum around Targeted HTTP Cache Control and that Netlify supports it, we can implement ISR in Nitro via these simple, standard HTTP headers instead. With the
isrroute rule, the new preset uses a newdurablecache-control directive (#2571).All netlify presets now leverage from better static asset handling to avoid extra function invocations and saving costs (#2822, #2823).
Vercel
When using
isrroute rule, by default, query paramas are ignored by cache. Now, you can pass an options object toisr: {}route rule to configure caching behavior (#2780). Read more in docs.AWS Lambda
We have experimented streaming support for
aws-lambda(#2412) and added it as an opt-in flag to enable streaming in supported deployments usingawsLambda: { streaming: true }nitro config (#2786).New presets
We have added support for genezio (#2637) and zerops (#2698) deployment providers.
Other changes
Enhancements
Generate types for runtime config
Support
ignoreoption for server assetsExpose
getRouteRulesForPathfrom nitro runtimeopenapi: Support configuration via
openapiEnvironment specific event handlers
Experimental
defineRouteMetaAllow customizing
apiBaseURL,apiDirandroutesDirAdd
gitlab-pagesstatic providerCompatibility date support
config: Warn if the runtime config is not serializable
open-api: Production mode support
deno-server: Use output
node_modulesforstarttaskdev-server: Redirect requests without base URL
firebase: Upgrade default runtime to node 20
Add
.sqlto the default raw file extensionsRoute groups support
renderer: Add
render:beforehookAdd
.pdfand.wasmto compressible mime typesInclude preset config in
.output/nitro.jsonLimit open files in
generateFSTreenetlify-legacy: Exclude static paths from server handler
netlify, netlify-edge: Exclude static paths from server handler
cache: Set
ttlfor native expiration (with SWR disabled)
Fixes
deno-server: Always inject
processfromnode:processexternals: Compare package paths against normalized
idazure: Correctly handle
maxAgecookie optionAvoid named exports from
package.jsonMore compatibility for import from
nitropack/runtime/*build: Correctly watch custom
apiDirandroutesDirMake sure nitro runtime goes to one chunk
Backward compatibility types for v2
handler-meta: Check for
.namewithundefinedvalue inObjectExpressionHide unhandled error messages in prod
prerender: Allow ignoring errors in
prerender:generatehookOnly hide messages of unhandled errors in prod
prerender: Skip protocol relative links
Ensure legacy runtime config types are populated
Ensure legacy hook types are populated
Do not generate runtime config types with an external framework
prerender: Log error stack traces
cache: Use top-level
functionto avoid rollup chunk ordering issuescli: Respect custom
buildDiroption fortaskssubcommandInitialize nitro app before plugins run
cloudflare-module: Use correct types for email and queue events/hooks
azure-functions: Follow symlinks in zip bundle
firebase: Validate custom
serverFunctionNameAdd
db0andstd-envtoruntimeDependencieserror: Add
cache-control: no-cachefor 404 responsesrenderer: Check
ctx.responsecf-pages: Only create
wrangler.tomlif the config is not emptynetlify: Added missing quotes in utils
netlify: Match ISR route rules when path has a query string
cache: Try decode path
cloudflare: Support custom
baseURLHandle incompatible compatibility date for presets
2.9.7
27 Jun 2024github-pages: Prerender
/by defaultDeduplicate plugins
Add
.tsxand.jsxto node-resolve extensions
Note
Release of Nitro 2.10 might little bit take longer (after Nitro 3.0 release) in order to make sure all major refactors are nonbreaking and tested enough. In the meantime, 2.9.7 adds important fixes.
Fixes
github-pages: Prerender
/by defaultDeduplicate plugins
Add
.tsxand.jsxto node-resolve extensionstypescript: Set
compilerOptions.noEmitto avoidtsconfig.jsonwarningprerender: Only try to add
/after prerender:routes hookPass custom entry filename when resolving prerenderer
public-assets: Do not shadow paths that share prefix
openapi: Update swagger-ui version to v5 for OpenAPI v3.1 support
Convert
CapturedErrorContextto interface to allow type augmentationrenderer: Check full path for
/favicon.icoplaceholderUse relative paths in
nitro-config.d.tsprerender: Extract links from explicit html routes
cloudflare-pages: Remove
.htmlextension from generated_routes.jsoncore: Resolve modules with esm compatibility
Update cli preset with esm module format
types: Infer types correctly when method is omitted
deno-server: Explicitly remove cert/key from options if either is not set
azure: Correctly handle maxAge cookie option
netlify: Ensure preview command is correct
iis: Deep merge configs
iis: Parse without explicitArray to allow merging
web.configvercel: Support custom baseURL
Lower-case accepted handler method
defineCachedEventHandler: Add
event.context.cache
2.9.6
2 Apr 2024Generate root/src directory aliases
externals: Skip resolving virtual ids start with
\0types: Account for
undefinedvalue for$fetchreturn type
Fixes
Generate root/src directory aliases
externals: Skip resolving virtual ids start with
\0types: Account for
undefinedvalue for$fetchreturn typecloudflare-pages: Use predefined wildcards in
routes.exclude
2.9.5
25 Mar 2024openapi: Add experimental
/_nitro/scalarendpointopenapi: Use dynamic host + port
openapi: Add
schemato generated parameters
Fixes and Improvements
openapi: Add experimental
/_nitro/scalarendpointopenapi: Use dynamic host + port
openapi: Add
schemato generated parametersopenapi: Avoid double slash for base
options: Set
scheduledTasksto an empty object by defaultprerender: Call
nitroAppclose hook when done prerenderingtypes: Return
TfromSerializewhen it extendsundefinedraw: Exclude yaml from raw plugin
externals: Check explicit inline rules on resolved id
raw: Allow importing relative paths
types: Make c12 env types available for
NitroConfignetlify-edge: Write
_headersand_redirectscloudflare-pages: Write
_headersand_redirectsfor non static buildsnetlify: Allow writing
config.jsonAllow importing utils from
nitropack/runtimeopenapi: Upgrade to openapi 3.1
Use
.d.tsfor runtime generated types
2.9.4
15 Mar 2024Handle path negations when scanning public assets
pkg: Add
ioredisas unstorage peer dependency
Fixes
Handle path negations when scanning public assets
pkg: Add
ioredisas unstorage peer dependency
2.9.3
10 Mar 2024raw: Use mime to chck binary types and exclude
.json
2.9.2
8 Mar 2024database: CamelCase the connector name
Respect
imports.autoImport: falseserver-assets: Mark
yaml,json,json5andcsvas text
Fixes
database: CamelCase the connector name
Respect
imports.autoImport: falseserver-assets: Mark
yaml,json,json5andcsvas textimport-meta: Import
processfromnode:processfor node compatible builds (deno)
2.9.1
29 Feb 2024Dev:
remoteAddressmight be undefined forx-forwarded-forDisable scheduled tasks in testing environment
Fixes
Dev:
remoteAddressmight be undefined forx-forwarded-forDisable scheduled tasks in testing environment
2.9.0
28 Feb 2024- Deprecated
presets: Deprecate
lagon prerender: Support function/RegExp for
prerender.ignoreCLI: Show meta framework name on server build success
🎉 Released live from Vue.js Amsterdam
What is new?
🏃♂️ Nitro Tasks
All changes
Enhancements
prerender: Support function/RegExp for
prerender.ignoreCLI: Show meta framework name on server build success
Presets: Add zeabur preset
Experimental nitro tasks
Add types:extend hook
Allow oveeridng nested runtime config with env
wasm: Universal support with esm import syntax
wasm: Migrate to unjs/unwasm
zeabur: Support zeaburStatic and auto detect preset
runtime-config: Experimental env expansion support
Support binary server assets
Experimental websocket support
dev: Expose upgrade handler
Experimental database layer
Experimental scheduled tasks
cache: Support async shouldBypassCache and shouldInvalidateCache
prerender: Add total prerender time
Presets: Add koyeb preset
providers: Support alwaysdata hosting provider
routeRules: Allow wildcard redirects
Fixes
rollup: Avoid preserving relative externals
wasm: Directly generate chunk exports
iis-node: Correctly escape backslashes for port fix
deno-deploy: Shim
x-forwarded-forandx-forwarded-protoheadersAdd
baseURLto openapi generated urldev: Correctly set
x-forwarded-*headersazure: Add
18and20to supported node versionsazure: Pass body to the context as-is
dev: Only mock consola in production
Default to bundler module resolution
Handle optional
routeHandler.routein rollup chunkFile extension stripping in
writeTypesfunctioncache: Detect malformed data read from storage
cacheEventHandler: Provide event.fetch and event.$fetch
module: Resolve modules with jiti directly
Documentation
- Deprecated
presets: Deprecate
lagon
2.8.1
29 Nov 2023dev: Conditionally access worker address for build info
Force use wasm import strategy for windows
netlify-lambda: Handle base64 encoded body
Fixes
dev: Conditionally access worker address for build info
Force use wasm import strategy for windows
netlify-lambda: Handle base64 encoded body
cloudflare: Wasm support with dynamic chunks
prerenderer: Write responses with json signature to original path
2.8.0
20 Nov 2023Support modules to extend nitro builder
Support
inlinemode forserveStaticAdd experimental
winterjspreset
What is new?
Zero config deployment to AWS Amplify Hosting
We have been closely working with the AWS Amplify team to bring you a zero-config experience AWS deployment and it is ready today! Read more in the deployment guide.
Code splitting enabled for Cloudflare Pages and Modules
Code-splitting support is now enabled for Cloudflare Pages and Modules presets making startup-time even faster by leveraging lazy chunks. (read more: (#1905))
Rollup v4 with native SWC-based parser
We've upgraded Nitro to the latest Rollup v4, powered native SWC-based parser for even faster builds (#5073) 🔥
Normally, you won't need any specific changes in your project. You can also ignore warnings about compatibility with
rollup-plugin-visualizer. If you're adding a custom Rollup plugin or using Vite v4, you might encounter type issues due to duplicate dependencies. You can either use theresolutionsfield in yourpackage.jsonor simply ignore this warning until Nuxt upgrades to Vite v5 (soon!).Modules support to extend Nitro core
With this release, we have introduced a new advanced feature to extend the Nitro builder core. (more documentation will be available soon)
Example:
modules/test.ts(server/modules/test.tsfor Nuxt projects)import type { NitroModule } from "nitropack"; export default <NitroModule>{ name: "my-nitro-module", async setup(nitro) { console.log("Running custom nitro module..."); await nitro.updateConfig({ routeRules: { "/**": { swr: true }, }, }); }, };H3 v1.9
h3 v1.9.0 comes with new
getValidatedRouterParamsandgetRequestFingerprintutilities,decodeoptions forgetRouterParamand auto-completion for headers in your IDE!More coming soon
There are more exciting features including tasks, db layer, and WebSocket API planned for the next minor releases. Stay tuned!
Changelog
Enhancements
Support modules to extend nitro builder
Support
inlinemode forserveStaticAdd experimental
winterjspresetAllow setting preset using
SERVER_PRESETenvironment variablecloudflare-pages, Cloudflare-module: Enable code splitting by default
Support
frameworkconfigAdd AWS Amplify Hosting preset
Upgrade to Rollup v4
Improve
nitro.jsonbuild infoaws-amplify: Support static builds
Add
defineNitroErrorHandlertype helper
Fixes
cloudflare-pages: Filter out overlapping public assets dirs
scanner: Allow having HTTP method as part of the route name
Generate route types with resolve path and stripped extension
Scan dirs for unimport on initialization
aws-amplify: Register and auto detect
prerender: Decode generated routes
Disabled public asset handler name is
nullprerender: Decode URIs in headers
error: Respect accept:
text/htmlrequest headerprerender: Filter encoded links starting with
#
Types
Export
SerializeTupleandSerializeObjecttypes
2.7.2
28 Oct 2023cloudflare-pages: Filter out overlapping public assets dirs
2.7.1
26 Oct 2023Recursively simplify returned objects
cache: Fix
etagandlast-modifiedvaluescache: Invalidate wrongly cached handler entities
Fixes
Recursively simplify returned objects
cache: Fix
etagandlast-modifiedvaluescache: Invalidate wrongly cached handler entities
2.7.0
19 Oct 2023vercel: Support
bypassTokenfor on-demand static reganarationprerender: Support
retryandretryDelayAllow disabling compressed size calculation
Enhancements
vercel: Support
bypassTokenfor on-demand static reganarationprerender: Support
retryandretryDelayAllow disabling compressed size calculation
Performance
Use native fetch for node >= 18 to reduce %40 of bundle size!
Fixes
Sort dependencies in
.output/package.jsonAdd
application/javascriptmime type in lambda utilsrenderer: Allow all h3 handled body types
dev: Safe error message override
azure: Fix cookie format normalization
Exclude undefined from hook types
iis-node: Pass
PORTasNITRO_UNIX_SOCKETaws-lambda: Handle
event.isBase64Encodedcache: Allow overriding integrity
cache: Write SWR and update errors to the console
cache: Only return validated stale value
cache: Only invalidate if validate returns false
Watch plugins directory
cache: Allow setting multiple set-cookie headers (bad practice!)
prerender: Decode HTML entities in rendered links
storage: Validate and skip invalid mounts
cache: Validate
entry.valueto have value for cached handlerscache: Fix event handler integrity hash generation
cache: Set cache item before returning response on first request
2.6.3
7 Sep 2023firebase: Apply region for gen2 deployments
cloudflare-pages: Autodetect static preset
Resolve output dirs relative to
rootDir
Fixes
firebase: Apply region for gen2 deployments
cloudflare-pages: Autodetect static preset
Resolve output dirs relative to
rootDirprerender: Allow disabling html sub-folders
firebase: Use correct key when importing firebase
httpsOptionsAwait on
send()callsBun dev compatibility
aws-lambda,netlify-lambda: Binary body v2 and cookies v1
iis: Merge
web.config
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.