[{"data":1,"prerenderedAt":1383},["ShallowReactive",2],{"navigation":3,"-docs-migration":389,"-docs-migration-surround":1378},[4,83,212,218,374,386],{"title":5,"path":6,"stem":7,"children":8,"icon":82},"","/docs","1.docs/1.index",[9,12,17,22,27,32,37,42,47,52,57,62,67,72,77],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-compass",{"title":13,"path":14,"stem":15,"icon":16},"Quick Start","/docs/quick-start","1.docs/2.quick-start","i-lucide-zap",{"title":18,"path":19,"stem":20,"icon":21},"Renderer","/docs/renderer","1.docs/4.renderer","ri:layout-masonry-line",{"title":23,"path":24,"stem":25,"icon":26},"Routing","/docs/routing","1.docs/5.routing","ri:direction-line",{"title":28,"path":29,"stem":30,"icon":31},"Assets","/docs/assets","1.docs/50.assets","ri:image-2-line",{"title":33,"path":34,"stem":35,"icon":36},"Configuration","/docs/configuration","1.docs/50.configuration","ri:settings-3-line",{"title":38,"path":39,"stem":40,"icon":41},"Database","/docs/database","1.docs/50.database","ri:database-2-line",{"title":43,"path":44,"stem":45,"icon":46},"Lifecycle","/docs/lifecycle","1.docs/50.lifecycle","i-lucide-layers",{"title":48,"path":49,"stem":50,"icon":51},"Plugins","/docs/plugins","1.docs/50.plugins","ri:plug-line",{"title":53,"path":54,"stem":55,"icon":56},"Tasks","/docs/tasks","1.docs/50.tasks","codicon:run-all",{"title":58,"path":59,"stem":60,"icon":61},"Server Entry","/docs/server-entry","1.docs/6.server-entry","ri:server-line",{"title":63,"path":64,"stem":65,"icon":66},"Cache","/docs/cache","1.docs/7.cache","ri:speed-line",{"title":68,"path":69,"stem":70,"icon":71},"KV Storage","/docs/storage","1.docs/8.storage","carbon:datastore",{"title":73,"path":74,"stem":75,"icon":76},"Migration Guide","/docs/migration","1.docs/99.migration","ri:arrow-right-up-line",{"title":78,"path":79,"stem":80,"icon":81},"Nightly Channel","/docs/nightly","1.docs/99.nightly","ri:moon-fill","i-lucide-book-open",{"title":84,"path":85,"stem":86,"children":87,"icon":89},"Deploy","/deploy","2.deploy/0.index",[88,90,111],{"title":84,"path":85,"stem":86,"icon":89},"ri:upload-cloud-2-line",{"title":91,"path":92,"stem":93,"children":94,"page":110},"Runtimes","/deploy/runtimes","2.deploy/10.runtimes",[95,100,105],{"title":96,"path":97,"stem":98,"icon":99},"Node.js","/deploy/runtimes/node","2.deploy/10.runtimes/1.node","akar-icons:node-fill",{"title":101,"path":102,"stem":103,"icon":104},"Bun","/deploy/runtimes/bun","2.deploy/10.runtimes/bun","simple-icons:bun",{"title":106,"path":107,"stem":108,"icon":109},"Deno","/deploy/runtimes/deno","2.deploy/10.runtimes/deno","simple-icons:deno",false,{"title":112,"path":113,"stem":114,"children":115,"page":110},"Providers","/deploy/providers","2.deploy/20.providers",[116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208],{"title":117,"path":118,"stem":119},"Alwaysdata","/deploy/providers/alwaysdata","2.deploy/20.providers/alwaysdata",{"title":121,"path":122,"stem":123},"AWS Lambda","/deploy/providers/aws","2.deploy/20.providers/aws",{"title":125,"path":126,"stem":127},"AWS Amplify","/deploy/providers/aws-amplify","2.deploy/20.providers/aws-amplify",{"title":129,"path":130,"stem":131},"Azure","/deploy/providers/azure","2.deploy/20.providers/azure",{"title":133,"path":134,"stem":135},"Cleavr","/deploy/providers/cleavr","2.deploy/20.providers/cleavr",{"title":137,"path":138,"stem":139},"Cloudflare","/deploy/providers/cloudflare","2.deploy/20.providers/cloudflare",{"title":141,"path":142,"stem":143},"Deno Deploy","/deploy/providers/deno-deploy","2.deploy/20.providers/deno-deploy",{"title":145,"path":146,"stem":147},"DigitalOcean","/deploy/providers/digitalocean","2.deploy/20.providers/digitalocean",{"title":149,"path":150,"stem":151},"Firebase","/deploy/providers/firebase","2.deploy/20.providers/firebase",{"title":153,"path":154,"stem":155},"Flightcontrol","/deploy/providers/flightcontrol","2.deploy/20.providers/flightcontrol",{"title":157,"path":158,"stem":159},"Genezio","/deploy/providers/genezio","2.deploy/20.providers/genezio",{"title":161,"path":162,"stem":163},"GitHub Pages","/deploy/providers/github-pages","2.deploy/20.providers/github-pages",{"title":165,"path":166,"stem":167},"GitLab Pages","/deploy/providers/gitlab-pages","2.deploy/20.providers/gitlab-pages",{"title":169,"path":170,"stem":171},"Heroku","/deploy/providers/heroku","2.deploy/20.providers/heroku",{"title":173,"path":174,"stem":175},"IIS","/deploy/providers/iis","2.deploy/20.providers/iis",{"title":177,"path":178,"stem":179},"Koyeb","/deploy/providers/koyeb","2.deploy/20.providers/koyeb",{"title":181,"path":182,"stem":183},"Netlify","/deploy/providers/netlify","2.deploy/20.providers/netlify",{"title":185,"path":186,"stem":187},"Platform.sh","/deploy/providers/platform-sh","2.deploy/20.providers/platform-sh",{"title":189,"path":190,"stem":191},"Render.com","/deploy/providers/render","2.deploy/20.providers/render",{"title":193,"path":194,"stem":195},"StormKit","/deploy/providers/stormkit","2.deploy/20.providers/stormkit",{"title":197,"path":198,"stem":199},"Vercel","/deploy/providers/vercel","2.deploy/20.providers/vercel",{"title":201,"path":202,"stem":203},"Zeabur","/deploy/providers/zeabur","2.deploy/20.providers/zeabur",{"title":205,"path":206,"stem":207},"Zephyr Cloud","/deploy/providers/zephyr","2.deploy/20.providers/zephyr",{"title":209,"path":210,"stem":211},"Zerops","/deploy/providers/zerops","2.deploy/20.providers/zerops",{"title":213,"path":214,"stem":215,"children":216,"icon":36},"Config","/config","3.config/0.index",[217],{"title":213,"path":214,"stem":215,"icon":36},{"title":219,"path":220,"stem":221,"children":222,"icon":224},"Examples","/examples","4.examples/0.index",[223,225,230,235,240,245,249,254,259,264,269,274,279,283,288,292,296,301,306,311,316,321,326,331,336,341,345,350,355,359,364,369],{"title":219,"path":220,"stem":221,"icon":224},"i-lucide-folder-code",{"title":226,"path":227,"stem":228,"icon":229},"API Routes","/examples/api-routes","4.examples/api-routes","i-lucide-route",{"title":231,"path":232,"stem":233,"icon":234},"Auto Imports","/examples/auto-imports","4.examples/auto-imports","i-lucide-import",{"title":236,"path":237,"stem":238,"icon":239},"Cached Handler","/examples/cached-handler","4.examples/cached-handler","i-lucide-clock",{"title":241,"path":242,"stem":243,"icon":244},"Custom Error Handler","/examples/custom-error-handler","4.examples/custom-error-handler","i-lucide-alert-circle",{"title":38,"path":246,"stem":247,"icon":248},"/examples/database","4.examples/database","i-lucide-database",{"title":250,"path":251,"stem":252,"icon":253},"Elysia","/examples/elysia","4.examples/elysia","i-skill-icons-elysia-dark",{"title":255,"path":256,"stem":257,"icon":258},"Express","/examples/express","4.examples/express","i-simple-icons-express",{"title":260,"path":261,"stem":262,"icon":263},"Fastify","/examples/fastify","4.examples/fastify","i-simple-icons-fastify",{"title":265,"path":266,"stem":267,"icon":268},"Hello World","/examples/hello-world","4.examples/hello-world","i-lucide-sparkles",{"title":270,"path":271,"stem":272,"icon":273},"Hono","/examples/hono","4.examples/hono","i-logos-hono",{"title":275,"path":276,"stem":277,"icon":278},"Import Alias","/examples/import-alias","4.examples/import-alias","i-lucide-at-sign",{"title":280,"path":281,"stem":282,"icon":46},"Middleware","/examples/middleware","4.examples/middleware",{"title":284,"path":285,"stem":286,"icon":287},"Mono JSX","/examples/mono-jsx","4.examples/mono-jsx","i-lucide-brackets",{"title":289,"path":290,"stem":291,"icon":287},"Nano JSX","/examples/nano-jsx","4.examples/nano-jsx",{"title":48,"path":293,"stem":294,"icon":295},"/examples/plugins","4.examples/plugins","i-lucide-plug",{"title":297,"path":298,"stem":299,"icon":300},"Custom Renderer","/examples/renderer","4.examples/renderer","i-lucide-code",{"title":302,"path":303,"stem":304,"icon":305},"Runtime Config","/examples/runtime-config","4.examples/runtime-config","i-lucide-settings",{"title":307,"path":308,"stem":309,"icon":310},"Server Fetch","/examples/server-fetch","4.examples/server-fetch","i-lucide-arrow-right-left",{"title":312,"path":313,"stem":314,"icon":315},"Shiki","/examples/shiki","4.examples/shiki","i-lucide-highlighter",{"title":317,"path":318,"stem":319,"icon":320},"Virtual Routes","/examples/virtual-routes","4.examples/virtual-routes","i-lucide-box",{"title":322,"path":323,"stem":324,"icon":325},"Vite Nitro Plugin","/examples/vite-nitro-plugin","4.examples/vite-nitro-plugin","i-logos-vitejs",{"title":327,"path":328,"stem":329,"icon":330},"Vite RSC","/examples/vite-rsc","4.examples/vite-rsc","i-logos-react",{"title":332,"path":333,"stem":334,"icon":335},"Vite SSR HTML","/examples/vite-ssr-html","4.examples/vite-ssr-html","i-logos-html-5",{"title":337,"path":338,"stem":339,"icon":340},"SSR with Preact","/examples/vite-ssr-preact","4.examples/vite-ssr-preact","i-logos-preact",{"title":342,"path":343,"stem":344,"icon":330},"SSR with React","/examples/vite-ssr-react","4.examples/vite-ssr-react",{"title":346,"path":347,"stem":348,"icon":349},"SSR with SolidJS","/examples/vite-ssr-solid","4.examples/vite-ssr-solid","i-logos-solidjs-icon",{"title":351,"path":352,"stem":353,"icon":354},"SSR with TanStack Router","/examples/vite-ssr-tsr-react","4.examples/vite-ssr-tsr-react","i-simple-icons-tanstack",{"title":356,"path":357,"stem":358,"icon":354},"SSR with TanStack Start","/examples/vite-ssr-tss-react","4.examples/vite-ssr-tss-react",{"title":360,"path":361,"stem":362,"icon":363},"SSR with Vue Router","/examples/vite-ssr-vue-router","4.examples/vite-ssr-vue-router","i-logos-vue",{"title":365,"path":366,"stem":367,"icon":368},"Vite + tRPC","/examples/vite-trpc","4.examples/vite-trpc","i-simple-icons-trpc",{"title":370,"path":371,"stem":372,"icon":373},"WebSocket","/examples/websocket","4.examples/websocket","i-lucide-radio",{"title":375,"path":376,"stem":377,"children":378},"Blog","/blog","9.blog",[379,382],{"title":375,"path":376,"stem":380,"icon":381},"9.blog/index","i-lucide-file-text",{"title":383,"path":384,"stem":385,"icon":381},"Nitro v3 Beta is here!","/blog/v3-beta","9.blog/1.v3-beta",{"title":5,"path":387,"stem":388},"/","index",{"id":390,"title":73,"body":391,"description":5,"extension":1373,"meta":1374,"navigation":1375,"path":74,"seo":1376,"stem":75,"__hash__":1377},"content/1.docs/99.migration.md",{"type":392,"value":393,"toc":1352,"icon":76},"minimark",[394,401,404,416,431,448,532,537,552,556,563,578,582,591,600,604,621,625,631,636,651,655,665,668,672,679,683,686,689,868,872,878,881,885,910,914,917,949,955,959,978,982,993,998,1031,1050,1054,1065,1112,1115,1142,1146,1152,1187,1190,1213,1248,1252,1267,1285,1289,1314,1318,1333,1337,1348],[395,396,397],"note",{},[398,399,400],"p",{},"\nThis is a living document for migrating from Nitro 2 to 3. Please check it regularly while using the beta version.",[398,402,403],{},"Nitro v3 introduces intentional backward-incompatible changes. This guide helps you migrate from Nitro v2.",[405,406,408,412,413],"h2",{"id":407},"nitropack-is-renamed-to-nitro",[409,410,411],"code",{},"nitropack"," is renamed to ",[409,414,415],{},"nitro",[398,417,418,419,425,426,430],{},"The NPM package ",[420,421,411],"a",{"href":422,"rel":423},"https://www.npmjs.com/package/nitropack",[424],"nofollow"," (v2) has been renamed to ",[420,427,415],{"href":428,"rel":429},"https://www.npmjs.com/package/nitro",[424]," (v3).",[398,432,433,437,438,440,441,443,444,447],{},[434,435,436],"strong",{},"Migration:"," Update the ",[409,439,411],{}," dependency to ",[409,442,415],{}," in ",[409,445,446],{},"package.json",":",[449,450,451,501],"CodeGroup",{},[452,453,458],"pre",{"className":454,"code":455,"filename":456,"language":457,"meta":5,"style":5},"language-diff shiki shiki-themes github-light github-dark github-dark","{\n  \"dependencies\": {\n--    \"nitropack\": \"latest\"\n++    \"nitro\": \"latest\"\n  }\n}\n","release channel","diff",[409,459,460,469,475,482,489,495],{"__ignoreMap":5},[461,462,465],"span",{"class":463,"line":464},"line",1,[461,466,468],{"class":467},"slsVL","{\n",[461,470,472],{"class":463,"line":471},2,[461,473,474],{"class":467},"  \"dependencies\": {\n",[461,476,478],{"class":463,"line":477},3,[461,479,481],{"class":480},"sLpD_","--    \"nitropack\": \"latest\"\n",[461,483,485],{"class":463,"line":484},4,[461,486,488],{"class":487},"sByVh","++    \"nitro\": \"latest\"\n",[461,490,492],{"class":463,"line":491},5,[461,493,494],{"class":467},"  }\n",[461,496,498],{"class":463,"line":497},6,[461,499,500],{"class":467},"}\n",[452,502,505],{"className":454,"code":503,"filename":504,"language":457,"meta":5,"style":5},"{\n  \"dependencies\": {\n--    \"nitropack\": \"latest\"\n++    \"nitro\": \"npm:nitro-nightly\"\n  }\n}\n","nightly channel",[409,506,507,511,515,519,524,528],{"__ignoreMap":5},[461,508,509],{"class":463,"line":464},[461,510,468],{"class":467},[461,512,513],{"class":463,"line":471},[461,514,474],{"class":467},[461,516,517],{"class":463,"line":477},[461,518,481],{"class":480},[461,520,521],{"class":463,"line":484},[461,522,523],{"class":487},"++    \"nitro\": \"npm:nitro-nightly\"\n",[461,525,526],{"class":463,"line":491},[461,527,494],{"class":467},[461,529,530],{"class":463,"line":497},[461,531,500],{"class":467},[398,533,534,536],{},[434,535,436],{}," Search your codebase and rename all instances of nitropack to nitro:",[452,538,540],{"className":454,"code":539,"language":457,"meta":5,"style":5},"-- import { defineNitroConfig } from \"nitropack/config\"\n++ import { defineNitroConfig } from \"nitro/config\"\n",[409,541,542,547],{"__ignoreMap":5},[461,543,544],{"class":463,"line":464},[461,545,546],{"class":480},"-- import { defineNitroConfig } from \"nitropack/config\"\n",[461,548,549],{"class":463,"line":471},[461,550,551],{"class":487},"++ import { defineNitroConfig } from \"nitro/config\"\n",[405,553,555],{"id":554},"nitroruntime","nitro/runtime",[398,557,558,559,562],{},"Runtime utils had been moved to individual ",[409,560,561],{},"nitro/*"," subpath exports. Refer to docs for usage.",[452,564,566],{"className":454,"code":565,"language":457,"meta":5,"style":5},"-- import { useStorage } from \"nitropack/runtime/storage\"\n++ import { useStorage } from \"nitro/storage\"\n",[409,567,568,573],{"__ignoreMap":5},[461,569,570],{"class":463,"line":464},[461,571,572],{"class":480},"-- import { useStorage } from \"nitropack/runtime/storage\"\n",[461,574,575],{"class":463,"line":471},[461,576,577],{"class":487},"++ import { useStorage } from \"nitro/storage\"\n",[405,579,581],{"id":580},"minimum-supported-nodejs-version-20","Minimum Supported Node.js Version: 20",[398,583,584,585,590],{},"Nitro now requires a minimum Node.js version of 20, as Node.js 18 reaches end-of-life in ",[420,586,589],{"href":587,"rel":588},"https://nodejs.org/en/about/previous-releases",[424],"April 2025",".",[398,592,593,594,599],{},"Please upgrade to the ",[420,595,598],{"href":596,"rel":597},"https://nodejs.org/en/download",[424],"latest LTS"," version (>= 20).",[398,601,602],{},[434,603,436],{},[605,606,607,615,618],"ul",{},[608,609,610,611,614],"li",{},"Check your local Node.js version using ",[409,612,613],{},"node --version"," and update if necessary.",[608,616,617],{},"If you use a CI/CD system for deployment, ensure that your pipeline is running Node.js 20 or higher.",[608,619,620],{},"If your hosting provider manages the Node.js runtime, make sure it's set to version 20, 22, or later.",[405,622,624],{"id":623},"type-imports","Type Imports",[398,626,627,628,590],{},"Nitro types are now only exported from ",[409,629,630],{},"nitro/types",[398,632,633,635],{},[434,634,436],{}," Import types from nitro/types instead of nitro:",[452,637,639],{"className":454,"code":638,"language":457,"meta":5,"style":5},"-- import { NitroRuntimeConfig } from \"nitropack\"\n++ import { NitroRuntimeConfig } from \"nitro/types\"\n",[409,640,641,646],{"__ignoreMap":5},[461,642,643],{"class":463,"line":464},[461,644,645],{"class":480},"-- import { NitroRuntimeConfig } from \"nitropack\"\n",[461,647,648],{"class":463,"line":471},[461,649,650],{"class":487},"++ import { NitroRuntimeConfig } from \"nitro/types\"\n",[405,652,654],{"id":653},"app-config-support-removed","App Config Support Removed",[398,656,657,658,661,662,590],{},"Nitro v2 supported a bundled app config that allowed defining configurations in ",[409,659,660],{},"app.config.ts"," and accessing them at runtime via ",[409,663,664],{},"useAppConfig()",[398,666,667],{},"This feature had been removed.",[398,669,670],{},[434,671,436],{},[398,673,674,675,678],{},"Use a regular ",[409,676,677],{},".ts"," file in your server directory and import it directly.",[405,680,682],{"id":681},"preset-updates","Preset updates",[398,684,685],{},"Nitro presets have been updated for the latest compatibility.",[398,687,688],{},"Some (legacy) presets have been removed or renamed.",[690,691,692,705],"table",{},[693,694,695],"thead",{},[696,697,698,702],"tr",{},[699,700,701],"th",{},"Old Preset",[699,703,704],{},"New Preset",[706,707,708,726,745,758,774,787,802,814,826,838,848,858],"tbody",{},[696,709,710,716],{},[711,712,713],"td",{},[409,714,715],{},"node",[711,717,718,721,722,725],{},[409,719,720],{},"node_middleware"," (export changed to ",[409,723,724],{},"middleware",")",[696,727,728,740],{},[711,729,730,733,734,733,737],{},[409,731,732],{},"cloudflare",", ",[409,735,736],{},"cloudflare_worker",[409,738,739],{},"cloudflare_module_legacy",[711,741,742],{},[409,743,744],{},"cloudflare_module",[696,746,747,752],{},[711,748,749],{},[409,750,751],{},"deno-server-legacy",[711,753,754,757],{},[409,755,756],{},"deno_server"," with Deno v2",[696,759,760,765],{},[711,761,762],{},[409,763,764],{},"netlify-builder",[711,766,767,770,771],{},[409,768,769],{},"netlify"," or ",[409,772,773],{},"netlify_edge",[696,775,776,781],{},[711,777,778],{},[409,779,780],{},"vercel-edge",[711,782,783,786],{},[409,784,785],{},"vercel"," with Fluid compute enabled",[696,788,789,797],{},[711,790,791,733,794],{},[409,792,793],{},"azure",[409,795,796],{},"azure_functions",[711,798,799],{},[409,800,801],{},"azure_swa",[696,803,804,809],{},[711,805,806],{},[409,807,808],{},"firebase",[711,810,811],{},[409,812,813],{},"firebase_app_hosting",[696,815,816,821],{},[711,817,818],{},[409,819,820],{},"iis",[711,822,823],{},[409,824,825],{},"iis_handler",[696,827,828,833],{},[711,829,830],{},[409,831,832],{},"deno",[711,834,835],{},[409,836,837],{},"deno_deploy",[696,839,840,845],{},[711,841,842],{},[409,843,844],{},"edgio",[711,846,847],{},"Discontinued",[696,849,850,855],{},[711,851,852],{},[409,853,854],{},"cli",[711,856,857],{},"Removed due to lack of use",[696,859,860,865],{},[711,861,862],{},[409,863,864],{},"service_worker",[711,866,867],{},"Removed due to instability",[405,869,871],{"id":870},"cloudflare-bindings-access","Cloudflare Bindings Access",[398,873,874,875,590],{},"In Nitro v2, Cloudflare environment variables and bindings were accessible via ",[409,876,877],{},"event.context.cloudflare.env",[398,879,880],{},"In Nitro v3, the Cloudflare runtime context is attached to the request's runtime object instead.",[398,882,883],{},[434,884,436],{},[452,886,888],{"className":454,"code":887,"language":457,"meta":5,"style":5},"-- const { cloudflare } = event.context\n-- const binding = cloudflare.env.MY_BINDING\n++ const { env } = event.req.runtime.cloudflare\n++ const binding = env.MY_BINDING\n",[409,889,890,895,900,905],{"__ignoreMap":5},[461,891,892],{"class":463,"line":464},[461,893,894],{"class":480},"-- const { cloudflare } = event.context\n",[461,896,897],{"class":463,"line":471},[461,898,899],{"class":480},"-- const binding = cloudflare.env.MY_BINDING\n",[461,901,902],{"class":463,"line":477},[461,903,904],{"class":487},"++ const { env } = event.req.runtime.cloudflare\n",[461,906,907],{"class":463,"line":484},[461,908,909],{"class":487},"++ const binding = env.MY_BINDING\n",[405,911,913],{"id":912},"changed-nitro-subpath-imports","Changed nitro subpath imports",[398,915,916],{},"Nitro v2 introduced multiple subpath exports, some of which have been removed or updated:",[605,918,919,931,938,944],{},[608,920,921,733,924,927,928,725],{},[409,922,923],{},"nitro/rollup",[409,925,926],{},"nitropack/core"," (use ",[409,929,930],{},"nitro/builder",[608,932,933,927,936,725],{},[409,934,935],{},"nitropack/runtime/*",[409,937,561],{},[608,939,940,943],{},[409,941,942],{},"nitropack/kit"," (removed)",[608,945,946,943],{},[409,947,948],{},"nitropack/presets",[398,950,951,952,954],{},"An experimental ",[409,953,942],{}," was introduced but has now been removed. A standalone Nitro Kit package may be introduced in the future with clearer objectives.",[398,956,957],{},[434,958,436],{},[605,960,961,975],{},[608,962,963,964,967,968,970,971,974],{},"Use ",[409,965,966],{},"NitroModule"," from ",[409,969,630],{}," instead of ",[409,972,973],{},"defineNitroModule"," from the kit.",[608,976,977],{},"Prefer built-in Nitro presets (external presets are only for evaluation purposes).",[405,979,981],{"id":980},"h3-v2","H3 v2",[398,983,984,985,989,990,590],{},"Nitro v3 upgrades to ",[420,986,981],{"href":987,"rel":988},"https://h3.dev",[424],", which includes API changes. All H3 utilities are imported from ",[409,991,992],{},"nitro/h3",[994,995,997],"h3",{"id":996},"web-standards","Web Standards",[398,999,1000,1001,733,1008,733,1015,1022,1023,1030],{},"H3 v2 is rewritten based on web standard primitives (",[420,1002,1005],{"href":1003,"rel":1004},"https://developer.mozilla.org/en-US/docs/Web/API/URL",[424],[409,1006,1007],{},"URL",[420,1009,1012],{"href":1010,"rel":1011},"https://developer.mozilla.org/en-US/docs/Web/API/Headers",[424],[409,1013,1014],{},"Headers",[420,1016,1019],{"href":1017,"rel":1018},"https://developer.mozilla.org/en-US/docs/Web/API/Request",[424],[409,1020,1021],{},"Request",", and ",[420,1024,1027],{"href":1025,"rel":1026},"https://developer.mozilla.org/en-US/docs/Web/API/Response",[424],[409,1028,1029],{},"Response",").",[398,1032,1033,1034,1037,1038,412,1041,1044,1045,1030],{},"Access to ",[409,1035,1036],{},"event.node.{req,res}"," is only available in Node.js runtime. ",[409,1039,1040],{},"event.web",[409,1042,1043],{},"event.req"," (instance of web ",[420,1046,1048],{"href":1017,"rel":1047},[424],[409,1049,1021],{},[994,1051,1053],{"id":1052},"response-handling","Response Handling",[398,1055,1056,1057,1060,1061,1064],{},"You should always explicitly ",[434,1058,1059],{},"return"," the response body or ",[434,1062,1063],{},"throw"," an error:",[452,1066,1068],{"className":454,"code":1067,"language":457,"meta":5,"style":5},"-- import { send, sendRedirect, sendStream } from \"nitro/h3\"\n-- send(event, value)\n-- sendStream(event, stream)\n-- sendRedirect(event, location, code)\n++ import { redirect } from \"nitro/h3\"\n++ return value\n++ return stream\n++ return redirect(event, location, code)\n",[409,1069,1070,1075,1080,1085,1090,1095,1100,1106],{"__ignoreMap":5},[461,1071,1072],{"class":463,"line":464},[461,1073,1074],{"class":480},"-- import { send, sendRedirect, sendStream } from \"nitro/h3\"\n",[461,1076,1077],{"class":463,"line":471},[461,1078,1079],{"class":480},"-- send(event, value)\n",[461,1081,1082],{"class":463,"line":477},[461,1083,1084],{"class":480},"-- sendStream(event, stream)\n",[461,1086,1087],{"class":463,"line":484},[461,1088,1089],{"class":480},"-- sendRedirect(event, location, code)\n",[461,1091,1092],{"class":463,"line":491},[461,1093,1094],{"class":487},"++ import { redirect } from \"nitro/h3\"\n",[461,1096,1097],{"class":463,"line":497},[461,1098,1099],{"class":487},"++ return value\n",[461,1101,1103],{"class":463,"line":1102},7,[461,1104,1105],{"class":487},"++ return stream\n",[461,1107,1109],{"class":463,"line":1108},8,[461,1110,1111],{"class":487},"++ return redirect(event, location, code)\n",[398,1113,1114],{},"Other changes:",[605,1116,1117,1126,1134],{},[608,1118,1119,1122,1123],{},[409,1120,1121],{},"sendError(event, error)"," → ",[409,1124,1125],{},"throw createError(error)",[608,1127,1128,1122,1131],{},[409,1129,1130],{},"sendNoContent(event)",[409,1132,1133],{},"return noContent(event)",[608,1135,1136,1122,1139],{},[409,1137,1138],{},"sendProxy(event, target)",[409,1140,1141],{},"return proxy(event, target)",[994,1143,1145],{"id":1144},"request-body","Request Body",[398,1147,1148,1149,1151],{},"Most body utilities can be replaced with native ",[409,1150,1043],{}," methods:",[452,1153,1155],{"className":454,"code":1154,"language":457,"meta":5,"style":5},"-- import { readBody, readRawBody, readFormData } from \"nitro/h3\"\n++ // Use native Request methods\n++ const json = await event.req.json()\n++ const text = await event.req.text()\n++ const formData = await event.req.formData()\n++ const stream = event.req.body\n",[409,1156,1157,1162,1167,1172,1177,1182],{"__ignoreMap":5},[461,1158,1159],{"class":463,"line":464},[461,1160,1161],{"class":480},"-- import { readBody, readRawBody, readFormData } from \"nitro/h3\"\n",[461,1163,1164],{"class":463,"line":471},[461,1165,1166],{"class":487},"++ // Use native Request methods\n",[461,1168,1169],{"class":463,"line":477},[461,1170,1171],{"class":487},"++ const json = await event.req.json()\n",[461,1173,1174],{"class":463,"line":484},[461,1175,1176],{"class":487},"++ const text = await event.req.text()\n",[461,1178,1179],{"class":463,"line":491},[461,1180,1181],{"class":487},"++ const formData = await event.req.formData()\n",[461,1183,1184],{"class":463,"line":497},[461,1185,1186],{"class":487},"++ const stream = event.req.body\n",[994,1188,1014],{"id":1189},"headers",[398,1191,1192,1193,1198,1199,1202,1203,733,1206,1209,1210,1030],{},"H3 now uses standard web ",[420,1194,1196],{"href":1010,"rel":1195},[424],[409,1197,1014],{},". Header values are always plain ",[409,1200,1201],{},"string"," (no ",[409,1204,1205],{},"null",[409,1207,1208],{},"undefined",", or ",[409,1211,1212],{},"string[]",[452,1214,1216],{"className":454,"code":1215,"language":457,"meta":5,"style":5},"-- import { getHeader, setHeader, getResponseStatus } from \"nitro/h3\"\n-- getHeader(event, \"x-foo\")\n-- setHeader(event, \"x-foo\", \"bar\")\n++ event.req.headers.get(\"x-foo\")\n++ event.res.headers.set(\"x-foo\", \"bar\")\n++ event.res.status // instead of getResponseStatus(event)\n",[409,1217,1218,1223,1228,1233,1238,1243],{"__ignoreMap":5},[461,1219,1220],{"class":463,"line":464},[461,1221,1222],{"class":480},"-- import { getHeader, setHeader, getResponseStatus } from \"nitro/h3\"\n",[461,1224,1225],{"class":463,"line":471},[461,1226,1227],{"class":480},"-- getHeader(event, \"x-foo\")\n",[461,1229,1230],{"class":463,"line":477},[461,1231,1232],{"class":480},"-- setHeader(event, \"x-foo\", \"bar\")\n",[461,1234,1235],{"class":463,"line":484},[461,1236,1237],{"class":487},"++ event.req.headers.get(\"x-foo\")\n",[461,1239,1240],{"class":463,"line":491},[461,1241,1242],{"class":487},"++ event.res.headers.set(\"x-foo\", \"bar\")\n",[461,1244,1245],{"class":463,"line":497},[461,1246,1247],{"class":487},"++ event.res.status // instead of getResponseStatus(event)\n",[994,1249,1251],{"id":1250},"handler-utils","Handler Utils",[452,1253,1255],{"className":454,"code":1254,"language":457,"meta":5,"style":5},"-- import { eventHandler, defineEventHandler } from \"nitro/h3\"\n++ import { defineHandler } from \"nitro\"\n",[409,1256,1257,1262],{"__ignoreMap":5},[461,1258,1259],{"class":463,"line":464},[461,1260,1261],{"class":480},"-- import { eventHandler, defineEventHandler } from \"nitro/h3\"\n",[461,1263,1264],{"class":463,"line":471},[461,1265,1266],{"class":487},"++ import { defineHandler } from \"nitro\"\n",[605,1268,1269,1277],{},[608,1270,1271,1122,1274],{},[409,1272,1273],{},"lazyEventHandler",[409,1275,1276],{},"defineLazyEventHandler",[608,1278,1279,1122,1282],{},[409,1280,1281],{},"useBase",[409,1283,1284],{},"withBase",[994,1286,1288],{"id":1287},"error-utils","Error Utils",[452,1290,1292],{"className":454,"code":1291,"language":457,"meta":5,"style":5},"-- import { createError, isError } from \"nitro/h3\"\n++ import { HTTPError } from \"nitro\"\n++ throw new HTTPError({ status: 404, message: \"Not found\" })\n++ HTTPError.isError(error)\n",[409,1293,1294,1299,1304,1309],{"__ignoreMap":5},[461,1295,1296],{"class":463,"line":464},[461,1297,1298],{"class":480},"-- import { createError, isError } from \"nitro/h3\"\n",[461,1300,1301],{"class":463,"line":471},[461,1302,1303],{"class":487},"++ import { HTTPError } from \"nitro\"\n",[461,1305,1306],{"class":463,"line":477},[461,1307,1308],{"class":487},"++ throw new HTTPError({ status: 404, message: \"Not found\" })\n",[461,1310,1311],{"class":463,"line":484},[461,1312,1313],{"class":487},"++ HTTPError.isError(error)\n",[994,1315,1317],{"id":1316},"nodejs-utils","Node.js Utils",[452,1319,1321],{"className":454,"code":1320,"language":457,"meta":5,"style":5},"-- import { defineNodeListener, fromNodeMiddleware, toNodeListener } from \"nitro/h3\"\n++ import { defineNodeHandler, fromNodeHandler, toNodeHandler } from \"nitro/h3\"\n",[409,1322,1323,1328],{"__ignoreMap":5},[461,1324,1325],{"class":463,"line":464},[461,1326,1327],{"class":480},"-- import { defineNodeListener, fromNodeMiddleware, toNodeListener } from \"nitro/h3\"\n",[461,1329,1330],{"class":463,"line":471},[461,1331,1332],{"class":487},"++ import { defineNodeHandler, fromNodeHandler, toNodeHandler } from \"nitro/h3\"\n",[405,1334,1336],{"id":1335},"optional-hooks","Optional Hooks",[398,1338,1339,1340,1343,1344,1347],{},"If you were using ",[409,1341,1342],{},"useNitroApp().hooks"," outside of Nitro plugins before, it might be undefined. Use new ",[409,1345,1346],{},"useNitroHooks()"," to guarantee having an instance.",[1349,1350,1351],"style",{},"html pre.shiki code .slsVL, html code.shiki .slsVL{--shiki-light:#24292E;--shiki-default:#E1E4E8;--shiki-dark:#E1E4E8}html pre.shiki code .sLpD_, html code.shiki .sLpD_{--shiki-light:#B31D28;--shiki-default:#FDAEB7;--shiki-dark:#FDAEB7}html pre.shiki code .sByVh, html code.shiki .sByVh{--shiki-light:#22863A;--shiki-default:#85E89D;--shiki-dark:#85E89D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":5,"searchDepth":471,"depth":471,"links":1353},[1354,1356,1357,1358,1359,1360,1361,1362,1363,1372],{"id":407,"depth":471,"text":1355},"nitropack is renamed to nitro",{"id":554,"depth":471,"text":555},{"id":580,"depth":471,"text":581},{"id":623,"depth":471,"text":624},{"id":653,"depth":471,"text":654},{"id":681,"depth":471,"text":682},{"id":870,"depth":471,"text":871},{"id":912,"depth":471,"text":913},{"id":980,"depth":471,"text":981,"children":1364},[1365,1366,1367,1368,1369,1370,1371],{"id":996,"depth":477,"text":997},{"id":1052,"depth":477,"text":1053},{"id":1144,"depth":477,"text":1145},{"id":1189,"depth":477,"text":1014},{"id":1250,"depth":477,"text":1251},{"id":1287,"depth":477,"text":1288},{"id":1316,"depth":477,"text":1317},{"id":1335,"depth":471,"text":1336},"md",{"icon":76},{"icon":76},{"title":73,"description":5},"p5Pbx6cL999eLbeBYnDfEMP6kwSuBY4Zop3IcZ3NMW4",[1379,1381],{"title":68,"path":69,"stem":70,"description":1380,"icon":71,"children":-1},"Nitro provides a built-in storage layer that can abstract filesystem or database or any other data source.",{"title":78,"path":79,"stem":80,"description":1382,"icon":81,"children":-1},"Nitro has a nightly release channel that automatically releases for every commit to main branch to try latest changes.",1775141599560]