\n\n**Problem:**\nIn the **development** mode all works perfectly (`npm run dev`)\nIn the **production** mode route `/id/1` returns 404 error (`npm run build && npm run preview`)\n\u003Cimg width=\"1242\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/17d7ebe0-6ba8-424f-9827-7f47fc31dd12\" />\n\n\n\n\n### Additional context\n\nI expect the **same behavior** in the dev and prod modes\n\nNitro code is [here](https://github.com/nitrojs/nitro/blob/3845524bbf50bc9ce43b914fbb1e9a10d6294046/src/runtime/internal/static.ts#L68) \n\n\n\n### Logs\n\n```shell-script\n\n```",[2902,2905,2908,2911],{"name":2903,"color":2904},"dx","C39D69",{"name":2906,"color":2907},"bug","d73a4a",{"name":2909,"color":2910},"nitro","bfd4f2",{"name":2912,"color":2913},"vite","3574D1",31514,"nuxt","closed","`Cannot find static asset` if nuxt dynamic route matches `buildAssetsDir`","2025-03-27T15:07:26Z","https://github.com/nuxt/nuxt/issues/31514",0.61768806,{"labels":2922,"number":2929,"owner":2915,"repository":2915,"state":2916,"title":2930,"updated_at":2931,"url":2932,"score":2933},[2923,2926],{"name":2924,"color":2925},"3.x","29bc7f",{"name":2927,"color":2928},"pending triage","E99695",15108,"Dynamic routes break when deploying built nuxt 3 app (boiler plate)","2024-01-30T18:02:05Z","https://github.com/nuxt/nuxt/issues/15108",0.651105,{"description":2935,"labels":2936,"number":2940,"owner":2915,"repository":2915,"state":2916,"title":2941,"updated_at":2942,"url":2943,"score":2944},"Hi there,\r\n\r\nI can't get dynamic routes to work with nuxt generate.. I must be missing something?\r\n\r\n - create the starter project (vue init nuxt/starter \u003Cproject-name>)\r\n - add the folder/file \"pages/posts/_id.vue\"\r\n - npm run generate\r\n\r\nthe docs tell me I should get an error (Could not generate the dynamic route /posts/:id, please add the mapping params in nuxt.config.js (generate.routeParams).) \r\n\r\nBut i don't get this error, its simply ignored and there is no file in the dist folder. Even if I do add the mapping params it is still ignored?\r\n\r\n\"npm run dev\" works as expected\r\n\r\nThanks\n\n\u003C!--cmty-->\u003C!--cmty_prevent_hook-->\n\u003Cdiv align=\"right\">\u003Csub>\u003Cem>This question is available on \u003Ca href=\"https://nuxtjs.cmty.io\">Nuxt.js\u003C/a> community (\u003Ca href=\"https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c602\">#c602\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[2937],{"name":2938,"color":2939},"2.x","d4c5f9",701,"npm run generate and dynamic routes","2023-01-18T15:39:41Z","https://github.com/nuxt/nuxt/issues/701",0.6540864,{"labels":2946,"number":2952,"owner":2915,"repository":2915,"state":2916,"title":2953,"updated_at":2954,"url":2955,"score":2956},[2947,2950,2951],{"name":2948,"color":2949},"stale","ffffff",{"name":2927,"color":2928},{"name":2938,"color":2939},7735,"dynamic routes can't handle .js in the url","2023-01-22T15:36:04Z","https://github.com/nuxt/nuxt/issues/7735",0.6586583,{"labels":2958,"number":2960,"owner":2915,"repository":2915,"state":2916,"title":2961,"updated_at":2962,"url":2963,"score":2964},[2959],{"name":2938,"color":2939},6088,"SPA Build 404 on refresh dynamic route","2024-03-14T15:31:53Z","https://github.com/nuxt/nuxt/issues/6088",0.6648651,{"description":2966,"labels":2967,"number":2969,"owner":2915,"repository":2915,"state":2916,"title":2970,"updated_at":2971,"url":2972,"score":2973},"```\n// nuxt.config.ts\n\nconst getPostRoutes = async () => {\n const endpoint = 'https://miraculous-happiness-d980c68696.strapiapp.com/api/blog-posts'\n const response = await fetch(endpoint)\n const {data} = await response.json()\n let articles = data.slice(0, 10);\n let slugs = articles.map((each) => {\n return '/blog/' + each.documentId\n })\n\n return slugs\n}\n\nexport default defineNuxtConfig({\n components: true,\n css: ['~/assets/styles/main.scss', '~/assets/styles/fonts.css'],\n modules: ['@vueuse/nuxt', '@nuxt/image', 'nuxt-keen-slider'],\n runtimeConfig: {\n public: {\n apiURL: process.env.NUXT_API_URL || 'https://miraculous-happiness-d980c68696.strapiapp.com/api/'\n }\n },\n nitro: {\n preset: process.env.NITRO_PRESET || 'node-server',\n prerender: {\n routes: ['/'],\n crawlLinks: true\n }\n },\n hooks: {\n // 'prerender:routes': async ({ routes }) => {\n // const response = await fetch(process.env.NUXT_API_URL + 'blog-posts');\n // const { data } = await response.json();\n // data.forEach((post) => { routes.add(`/blog/${post.documentId}`) }); // TODO: change on slug\n // },\n 'nitro:config': async (nitroConfig) => {\n // if (nitroConfig.dev) {\n // return\n // }\n let slugs = await getPostRoutes();\n nitroConfig.prerender.routes.push(...slugs)\n return\n }\n },\n compatibilityDate: '2025-04-18'\n})\n```\n\n\n\n```\n// [slug].vue\n\n\u003Ctemplate lang=\"pug\">\n div(v-if=\"post\")\n breadcrumbs(:paths=\"paths\")\n blog-hero-section(:title=\"post.title\" :category=\"post.category\" :reading-time=\"post.readingTime\")\n blog-article-content(:content=\"post.content\")\n //blog-category-news(title=\"Вам може сподобатись\" :items=\"mockNews.slice(3)\")\n banner-template\n\u003C/template>\n\n\u003Cscript setup lang=\"ts\">\nconst runtimeConfig = useRuntimeConfig()\nconst { slug } = useRoute().params\n\nconst postURL = new URL(runtimeConfig.public.apiURL + `blog-posts/${slug}`)\npostURL.searchParams.append('populate', '*')\nconst { data, error } = await useFetch(postURL.href, {\n key: 'post' + slug\n})\n\nconst post = data.value.data\n\nconst paths = ref([\n { name: 'Блог', link: '/blog' },\n { name: post.title }\n])\n\u003C/script>\n```\nI run dev server with command `npm run dev` command. I can open /blog/ page and it works fine, also I can go to blog/[slug].vue page from /blog/ route. But when I'm trying to reload page on blog/[slug].vue, I encounter error from image below\n\n",[2968],{"name":2927,"color":2928},31953,"Dev server does not build on dynamic route","2025-04-30T13:07:32Z","https://github.com/nuxt/nuxt/issues/31953",0.6677597,{"description":2975,"labels":2976,"number":2981,"owner":2915,"repository":2915,"state":2916,"title":2982,"updated_at":2983,"url":2984,"score":2985},"### Environment\n\nGithub Pages \r\n\r\nand\r\n\r\n------------------------------\r\n- Operating System: Windows_NT\r\n- Node Version: v20.11.0\r\n- Nuxt Version: 3.13.2\r\n- CLI Version: 3.14.0\r\n- Nitro Version: 2.9.7\r\n- Package Manager: npm@10.2.4\r\n- Builder: -\r\n- User Config: -\r\n- Runtime Modules: -\r\n- Build Modules: -\r\n-----------------------------\r\n\n\n### Reproduction\n\n- Fork: https://stackblitz.com/edit/github-gcu9d8?file=layouts%2Fdefault.vue\r\n- Run: npm run build-preview\r\n- Open: /bot/hey (can be any query)\r\n- Open Console \r\n- See the 404 error\n\n### Describe the bug\n\nWhen running it in dev mode you wont see any 404 but when running the builded source it drops an 404.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[2977,2978],{"name":2927,"color":2928},{"name":2979,"color":2980},"possible regression","B90A42",29233,"Dynamic route drops 404 at --preset github_pages","2024-11-17T21:42:46Z","https://github.com/nuxt/nuxt/issues/29233",0.67399067,{"description":2987,"labels":2988,"number":2993,"owner":2915,"repository":2915,"state":2916,"title":2994,"updated_at":2995,"url":2996,"score":2997},"### Environment\n\n- Operating System: `Windows_NT`\n- Node Version: `v18.20.7`\n- Nuxt Version: `3.15.4`\n- CLI Version: `3.21.1`\n- Nitro Version: `2.10.4`\n- Package Manager: `pnpm@9.14.2`\n- Builder: `-`\n- User Config: `app`, `ssr`, `compatibilityDate`, `devtools`, `modules`, `css`, `runtimeConfig`, `nitro`, `vite`\n- Runtime Modules: `@nuxt/eslint@1.1.0`, `@nuxtjs/tailwindcss@6.13.1`, `@pinia/nuxt@0.10.1`, `@nuxt/image@1.9.0`, `nuxt-swiper@2.0.0`\n- Build Modules: `-`\n\n### Reproduction\n\n- Execute nuxt generate\n- Go to output folder\n- Open index.html file using browser without security\n- 404 page not found \n\n### Describe the bug\n\nHi,\n\nWe are working in nuxt project and we need to develop an static app without nodeJS app server. \n\nIf we use app.vue component all it's working ok but when we create pages folder we receive page not found error to manage different routes with vue-router\n\nWe try to configure prerender routes with nitro but it is not working. \n\nPlease, could you help me? \n\nThank you\n\n### Additional context\n\nWe are using the following nuxt configuration:\n\n```\nimport legacy from '@vitejs/plugin-legacy';\n\nexport default defineNuxtConfig({\n app: {\n cdnURL: './',\n },\n ssr: false,\n compatibilityDate: '2024-11-01',\n devtools: { enabled: false },\n modules: ['@nuxt/eslint', '@nuxtjs/tailwindcss', '@pinia/nuxt', '@nuxt/image', 'nuxt-swiper'],\n css: ['~/assets/css/main.css'],\n runtimeConfig: {\n public: {\n apiBase: process.env.API_BASE_URL,\n authorization: process.env.AUTH_TOKEN,\n },\n },\n vite: {\n plugins: [legacy()],\n },\n});```\n\nThis is the following project structure\n\n\n\n### Logs\n\n```shell-script\nBrk9iX9n.js:9599 [nuxt] error caught during app initialization H3Error: Page not found: /C:/Users/Documents/workspace/nuxt-project/.output/public/index.html\n at createError$1 (Brk9iX9n.js:10488:15)\n at Brk9iX9n.js:14599:54\n at fn (Brk9iX9n.js:9683:20)\n at Object.runWithContext (Brk9iX9n.js:4306:18)\n at callWithNuxt (Brk9iX9n.js:9687:24)\n at Brk9iX9n.js:9533:41\n at EffectScope.run (Brk9iX9n.js:280:16)\n at Object.runWithContext (Brk9iX9n.js:9533:31)\n at Brk9iX9n.js:14599:23\n at Brk9iX9n.js:14028:64\n```",[2989,2990],{"name":2927,"color":2928},{"name":2991,"color":2992},"needs reproduction","FBCA04",31203,"Static pages not working on nuxt 3 project","2025-03-05T19:47:06Z","https://github.com/nuxt/nuxt/issues/31203",0.674669,{"description":2999,"labels":3000,"number":3002,"owner":2915,"repository":2915,"state":2916,"title":3003,"updated_at":3004,"url":3005,"score":3006},"### Environment\n\n------------------------------\r\n- Operating System: Windows_NT\r\n- Node Version: v18.20.2\r\n- Nuxt Version: 3.11.2\r\n- CLI Version: 3.11.1\r\n- Nitro Version: 2.9.6\r\n- Package Manager: npm@10.5.0\r\n- Builder: -\r\n- User Config: runtimeConfig, app, css, devtools, modules, glorious, plugins, pwa, nitro, routeRules\r\n- Runtime Modules: nuxt-glorious@1.1.2, @nuxtjs/tailwindcss@6.12.0, @nuxt/eslint@0.3.13, @nuxt/image@1.7.0, @vite-pwa/nuxt@0.8.0\r\n- Build Modules: -\r\n------------------------------\n\n### Reproduction\n\nhttps://stackblitz.com/edit/github-cpuxlf?file=README.md\n\n### Describe the bug\n\ni want use npm run generate, then command success full , dynamic route not load fx i have one folder with `news` name in news have two file `index.vue` and `[slug].vue` all route with `[slug].vue` show 404 page\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[3001],{"name":2927,"color":2928},28692,"dynamic route is not found !","2024-08-24T14:02:09Z","https://github.com/nuxt/nuxt/issues/28692",0.67521846,{"description":3008,"labels":3009,"number":3012,"owner":2915,"repository":2915,"state":2916,"title":3013,"updated_at":3014,"url":3015,"score":3016},"### Environment\r\n\r\n- Operating System: `Linux`\r\n- Node Version: `v18.14.0`\r\n- Nuxt Version: `3.2.3`\r\n- Nitro Version: `1.0.0`\r\n- Package Manager: `npm@9.3.1`\r\n- Builder: `vite`\r\n- User Config: `srcDir`, `modules`, `tailwindcss`, `vite`, `schemaOrg`, `telemetry`, `algolia`, `head`, `auth`, `viewport`, `css`, `build`, `runtimeConfig`\r\n- Runtime Modules: `genesis-design-system/nuxt`, `@nuxtjs/algolia@1.5.0`, `@nuxtjs/tailwindcss@6.4.1`, `formidable@2.1.1`, `nuxt-viewport@2.0.3`, `@nuxtjs/partytown@1.3.0`, `@vueuse/nuxt@9.13.0`, `@nuxtjs/i18n-edge@8.0.0-beta.9-27948515.3db6367`, `nuxt-schema-org@1.1.0-beta.6`, `nuxt-icon@0.1.8`, `@pinia/nuxt@0.4.7`, `@nuxtjs/i18n@8.0.0-beta.10`, `@sidebase/nuxt-auth@0.3.4`\r\n- Build Modules: `-`\r\n\r\n\r\n### Reproduction\r\n\r\nwe want to use dinamic urls like this... but throws an error\r\n` \u003Cimg class=\"w-70 h-70 mx-auto\" :src=\"'~/assets/img/'+link.icon+'.svg'\" alt=\"contact header\" />`\r\n\r\n[nuxt] error caught during app initialization Error: Page not found: /~/assets/img/chat.svg\r\n at Module.createError (/home/foticos/var/www/wanapix_next/node_modules/h3/dist/index.mjs:128:15)\r\n at /home/foticos/var/www/wanapix_next/node_modules/nuxt/dist/pages/runtime/plugins/router.mjs:141:113\r\n at triggerAfterEach (/home/foticos/var/www/wanapix_next/node_modules/vue-router/dist/vue-router.mjs:3306:13)\r\n at /home/foticos/var/www/wanapix_next/node_modules/vue-router/dist/vue-router.mjs:3209:13\r\n at process.processTicksAndRejections (/home/foticos/var/www/wanapix_next/lib/internal/process/task_queues.js:95:5)\r\n at async /home/foticos/var/www/wanapix_next/node_modules/nuxt/dist/pages/runtime/plugins/router.mjs:157:7\r\n at async createNuxtAppServer (/home/foticos/var/www/wanapix_next/node_modules/nuxt/dist/app/entry.mjs:30:7)\r\n at async default (/home/foticos/var/www/wanapix_next/node_modules/@nuxt/vite-builder/dist/runtime/vite-node.mjs:27:18)\r\n at async Object.renderToString (/home/foticos/var/www/wanapix_next/node_modules/vue-bundle-renderer/dist/runtime.mjs:172:19)\r\n at async file:///home/foticos/var/www/wanapix_next/.nuxt/dev/index.mjs:2945:21 {statusCode: 404, fatal: false, unhandled: false, statusMessage: 'Page not found: /~/assets/img/chat.svg', __nuxt_error: true, …}\r\n\r\nIf i use \r\n`\u003Cimg class=\"w-70 h-70 mx-auto\" :src=\"'_nuxt/assets/img/'+link.icon+'.svg'\" alt=\"contact header\" />`\r\n\r\nRuns Ok\r\n\r\n### Describe the bug\r\n\r\nwe want to use dinamic urls like this... but throws an error\r\n `\u003Cimg class=\"w-70 h-70 mx-auto\" :src=\"'~/assets/img/'+link.icon+'.svg'\" alt=\"contact header\" />`\r\n\r\n[nuxt] error caught during app initialization Error: Page not found: /~/assets/img/chat.svg\r\n at Module.createError (/home/foticos/var/www/wanapix_next/node_modules/h3/dist/index.mjs:128:15)\r\n at /home/foticos/var/www/wanapix_next/node_modules/nuxt/dist/pages/runtime/plugins/router.mjs:141:113\r\n at triggerAfterEach (/home/foticos/var/www/wanapix_next/node_modules/vue-router/dist/vue-router.mjs:3306:13)\r\n at /home/foticos/var/www/wanapix_next/node_modules/vue-router/dist/vue-router.mjs:3209:13\r\n at process.processTicksAndRejections (/home/foticos/var/www/wanapix_next/lib/internal/process/task_queues.js:95:5)\r\n at async /home/foticos/var/www/wanapix_next/node_modules/nuxt/dist/pages/runtime/plugins/router.mjs:157:7\r\n at async createNuxtAppServer (/home/foticos/var/www/wanapix_next/node_modules/nuxt/dist/app/entry.mjs:30:7)\r\n at async default (/home/foticos/var/www/wanapix_next/node_modules/@nuxt/vite-builder/dist/runtime/vite-node.mjs:27:18)\r\n at async Object.renderToString (/home/foticos/var/www/wanapix_next/node_modules/vue-bundle-renderer/dist/runtime.mjs:172:19)\r\n at async file:///home/foticos/var/www/wanapix_next/.nuxt/dev/index.mjs:2945:21 {statusCode: 404, fatal: false, unhandled: false, statusMessage: 'Page not found: /~/assets/img/chat.svg', __nuxt_error: true, …}\r\n\r\nIf i use \r\n`\u003Cimg class=\"w-70 h-70 mx-auto\" :src=\"'_nuxt/assets/img/'+link.icon+'.svg'\" alt=\"contact header\" />`\r\n\r\nRuns Ok\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Logs\r\n\r\n_No response_",[3010,3011],{"name":2924,"color":2925},{"name":2927,"color":2928},19498,"Dynamic assets image fails","2023-03-07T10:56:39Z","https://github.com/nuxt/nuxt/issues/19498",0.676623,["Reactive",3018],{},["Set"],["ShallowReactive",3021],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fXa6fDwzgjt17cDyfIb5ewvaJ-AyaVLXa6DzVWvmdm-0":-1},"/nuxt/nuxt/890"]