nitropack
2.13.6 · 2 Nov 2026MIT3.9M / weekRepositoryHomepagenpmAtom feed
2.13.6 is the newest release of 2.x.
In short
21 new24 fixed20 internal
Security
2 advisories affect 2.11.0; 2.13.4 fixes them
- ModerateNitro has an Open Redirect via Protocol-Relative URL Bypass in Wildcard Route RulesGHSA-9phm-9p8f-hw5m · 6 May 2026Fixed in 2.13.4
- ModerateNitro has a proxy scope bypass via percent-encoded path traversal in `routeRules`GHSA-5w89-w975-hf9q · 6 May 2026Fixed in 2.13.4
Release note
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 set NODE_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-agent headers or when requests were made to /api/*.
For more consistent behavior, any request not made from a browser (i.e., without the Accept: text/html header) 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 errorHandler config. If you want to fall back to the default error handler conditionally, you can simply return without 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 dev or nuxt dev command, 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:sqlite support (#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 baseURL Handling
For deployments that need to be served under a base URL (e.g., /admin), Nitro provides a baseURL config. 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 baseURL for 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 even process.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 a wrangler.toml file or using deployConfig flag, 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
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.