\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```",[1984,1987,1990,1993],{"name":1985,"color":1986},"dx","C39D69",{"name":1988,"color":1989},"bug","d73a4a",{"name":1991,"color":1992},"nitro","bfd4f2",{"name":1994,"color":1995},"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.604736,{"labels":2004,"number":2011,"owner":1997,"repository":1997,"state":1998,"title":2012,"updated_at":2013,"url":2014,"score":2015},[2005,2008],{"name":2006,"color":2007},"3.x","29bc7f",{"name":2009,"color":2010},"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.6485461,{"description":2017,"labels":2018,"number":2022,"owner":1997,"repository":1997,"state":1998,"title":2023,"updated_at":2024,"url":2025,"score":2026},"my dynamic route is working when there is no export default { ... }but when i try to validate my params it says \"This page could not be found\" i have created a folder called post under pages and put _slug.vue in it just like this \r\n\r\n> pages>post>_slug.vue\r\n\r\n this is how i go to my dynamic route \r\n\r\n`\u003Cnuxt-link :to=\"'/post/'+post.slug\">{{post.title}}\u003C/nuxt-link>`\r\n\r\nand this >_slug.vue \r\n\r\n```\r\n\u003Ctemplate>\r\n \u003Cdiv class=\"container has-text-centered\">\r\n \u003Cp>\r\n post page\r\n \u003C/p>\r\n \u003C/div>\r\n\u003C/template>\r\n\r\n\u003Cscript>\r\nexport default {\r\n\r\n validate({params}) {\r\n return !isNaN(+params.slug)\r\n },\r\n data(){\r\n\r\n },\r\n mounted(){\r\n console.log(`${params.slug}`)\r\n }\r\n}\r\n\u003C/script>\r\n```\r\n\r\nand i want my dynamic route to look like /post/:slug and this is router key in nuxt.config.js\r\n\r\n```\r\n router: {\r\n routes: [\r\n {\r\n name: 'post',\r\n path: '/post/:slug',\r\n component: 'pages/post/_slug.vue'\r\n },\r\n \r\n ]\r\n },\r\n\r\n```\n\n\u003C!--cmty-->\u003C!--cmty_prevent_hook-->\n\u003Cdiv align=\"right\">\u003Csub>\u003Cem>This question is available on \u003Ca href=\"https://cmty.app/nuxt\">Nuxt\u003C/a> community (\u003Ca href=\"https://cmty.app/nuxt/nuxt.js/issues/c7235\">#c7235\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[2019],{"name":2020,"color":2021},"2.x","d4c5f9",3435,"Dynamic routing not working","2023-01-18T16:24:08Z","https://github.com/nuxt/nuxt/issues/3435",0.6625656,{"description":2028,"labels":2029,"number":2031,"owner":1997,"repository":1997,"state":1998,"title":2032,"updated_at":2033,"url":2034,"score":2035},"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>",[2030],{"name":2020,"color":2021},701,"npm run generate and dynamic routes","2023-01-18T15:39:41Z","https://github.com/nuxt/nuxt/issues/701",0.66264176,{"description":2037,"labels":2038,"number":2043,"owner":1997,"repository":1997,"state":1998,"title":2044,"updated_at":2045,"url":2046,"score":2047},"### 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```",[2039,2040],{"name":2009,"color":2010},{"name":2041,"color":2042},"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.6635285,{"labels":2049,"number":2055,"owner":1997,"repository":1997,"state":1998,"title":2056,"updated_at":2057,"url":2058,"score":2059},[2050,2053,2054],{"name":2051,"color":2052},"stale","ffffff",{"name":2009,"color":2010},{"name":2020,"color":2021},7735,"dynamic routes can't handle .js in the url","2023-01-22T15:36:04Z","https://github.com/nuxt/nuxt/issues/7735",0.6647331,{"description":2061,"labels":2062,"number":2065,"owner":1997,"repository":1997,"state":1998,"title":2066,"updated_at":2067,"url":2068,"score":2069},"### Environment\n\n- Operating System: `Darwin`\r\n- Node Version: `v21.6.2`\r\n- Nuxt Version: `3.10.2`\r\n- CLI Version: `3.10.1`\r\n- Nitro Version: `2.8.1`\r\n- Package Manager: `yarn@1.22.21`\r\n- Builder: `-`\r\n- User Config: `devtools`, `typescript`, `srcDir`, `modules`, `i18n`, `app`, `runtimeConfig`\r\n- Runtime Modules: `@nuxtjs/i18n@8.1.1`, `@pinia/nuxt@0.5.1`, `@vee-validate/nuxt@4.12.5`, `@nuxtjs/color-mode@3.3.2`, `@nuxt/image@1.4.0`\r\n- Build Modules: `-`\r\n\n\n### Reproduction\n\n```ts\r\n// https://nuxt.com/docs/api/configuration/nuxt-config\r\nconst path = require('path');\r\nexport default defineNuxtConfig({\r\n devtools: { enabled: true },\r\n srcDir: 'src/',\r\n dir:{public: path.join(__dirname, 'public') }\r\n })\r\n\r\n```\n\n### Describe the bug\n\nI change the source directory to **src**, then place the public directory in a folder outside the src directory. Static assets work in dev (**yarn dev**) but in production (**yarn build**) they don't. I notice that static files are not copied when compiling in production.\r\n\r\n\r\nWhen I put the public folder in the src folder and don't change the **public** option, everything works fine.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[2063,2064],{"name":2006,"color":2007},{"name":2009,"color":2010},26509,"Static Asset does not work in the production version when changing public folders","2024-05-24T20:34:59Z","https://github.com/nuxt/nuxt/issues/26509",0.6710376,{"description":2071,"labels":2072,"number":2074,"owner":1997,"repository":1997,"state":1998,"title":2075,"updated_at":2076,"url":2077,"score":2078},"[https://nuxtjs.org/guide/commands#development-environment](url)\r\n\r\nThere is no mention of the files required by Nuxt when deploying it to live hosting.\r\n\r\nUsing Nuxt CLI, creates several empty folders such as\r\n\r\n- assets\r\n- components \r\n- layouts\r\n- pages\r\n- server\r\n\r\nUsing npm build .nuxt folder is created - do i simply upload the content of the full folder or are the dist folder....????\r\n\r\n\n\n\u003C!--cmty-->\u003C!--cmty_prevent_hook-->\n\u003Cdiv align=\"right\">\u003Csub>\u003Cem>This question is available on \u003Ca href=\"https://cmty.app/nuxt\">Nuxt\u003C/a> community (\u003Ca href=\"https://cmty.app/nuxt/nuxt.js/issues/c8947\">#c8947\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[2073],{"name":2020,"color":2021},5403,"What files and folder do you need to deploy production version on host","2023-01-18T20:10:50Z","https://github.com/nuxt/nuxt/issues/5403",0.671286,{"description":2080,"labels":2081,"number":2084,"owner":1997,"repository":1997,"state":1998,"title":2085,"updated_at":2086,"url":2087,"score":2088},"### 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_",[2082,2083],{"name":2006,"color":2007},{"name":2009,"color":2010},19498,"Dynamic assets image fails","2023-03-07T10:56:39Z","https://github.com/nuxt/nuxt/issues/19498",0.67167956,{"description":2090,"labels":2091,"number":2093,"owner":1997,"repository":1997,"state":1998,"title":2094,"updated_at":2095,"url":2096,"score":2097},"### 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_",[2092],{"name":2009,"color":2010},28692,"dynamic route is not found !","2024-08-24T14:02:09Z","https://github.com/nuxt/nuxt/issues/28692",0.67172045,["Reactive",2099],{},["Set"],["ShallowReactive",2102],{"TRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"Xa6fDwzgjt17cDyfIb5ewvaJ-AyaVLXa6DzVWvmdm-0":-1},"/nuxt/nuxt/890"]