",[],950,"nuxt","cli","open","Support tabs for `npx nuxi@latest module add`","2025-07-10T11:29:02Z","https://github.com/nuxt/cli/issues/950",0.68742263,{"description":3160,"labels":3161,"number":3165,"owner":3152,"repository":3152,"state":3166,"title":3167,"updated_at":3168,"url":3169,"score":3170},"### Environment\n\n- Operating System: Windows_NT\r\n- Node Version: v20.15.0\r\n- Nuxt Version: 3.12.3\r\n- CLI Version: 3.12.0\r\n- Nitro Version: 2.9.7\r\n- Package Manager: npm@10.7.0\r\n- Builder: -\r\n- User Config: future, devtools, components\r\n- Runtime Modules: -\r\n- Build Modules: -\n\n### Reproduction\n\n1. Run `npx nuxi@latest init --package-manager npm nuxt-config-formatting-repro`.\r\n2. Modify `nuxt.config.ts` to give it more \"depth\"\r\n3. Run `npm run dev`\r\n4. Accept the suggested compatibilityDate\r\n5. View the newly modified `nuxt.config.ts`\r\n\r\nExample repo here: https://github.com/minimusubi/nuxt-config-formatting-repro\r\nA diff of nuxt.config.ts before and after nuxt modifies it: https://github.com/minimusubi/nuxt-config-formatting-repro/compare/e1d42f089e44d42d30a1a0b27ef5c160f69deba2...fb1ae3af952a35e7a4fddac3a5aedaacc8ad2bb0\n\n### Describe the bug\n\n### Expected outcome\r\nAfter nuxt modifies `nuxt.config.ts`,\r\n\r\n- The file should be formatted similarly to how it was before\r\n- OR, at the very minimum\r\n- The file should be formatted consistently, even if it differs from previous formatting\r\n - Meaning,\r\n - If it's going to use spaces, use them. Always. 2 spaces? 4 spaces? It doesn't really matter, as long as it sticks to it.\r\n - If it's going to use tabs, use them. Don't use both.\r\n - Indentation should make sense.\r\n\r\nAlternatively,\r\n\r\n- Don't attempt to format the file\r\n\r\n### Actual outcome\r\nNuxt applies very odd indentation to `nuxt.config.ts`. Note that some lines use a wild number of tabs, and some lines use just a single (!) space.\r\n\r\nExample of a nuxt-modified config:\r\n```js\r\n// https://nuxt.com/docs/api/configuration/nuxt-config\r\nexport default defineNuxtConfig({\r\n future: {\r\n\t\t\t\t\tcompatibilityVersion: 4,\r\n\t},\r\n\r\n devtools: { enabled: false },\r\n\r\n // https://nuxt.com/docs/api/nuxt-config#components\r\n\tcomponents: [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tpath: '~/components/global',\r\n\t\t\t\t\t\t\t\t\tglobal: true,\r\n\t\t\t\t\t},\r\n\t\t\t\t\t'~/components',\r\n\t\t\t\t\t// This line is custom\r\n\t\t\t\t\t// https://github.com/nuxt/nuxt/discussions/17167#discussioncomment-3288741\r\n\t\t\t\t\t{ path: '~/components/common', pathPrefix: false },\r\n\t],\r\n\r\n compatibilityDate: '2024-07-04',\r\n});\r\n```\n\n### Additional context\n\nWith further inspection, it seems that\r\n\r\n- Whenever nuxt indents a line using tabs, it seems to (correctly) use a single tab for the first indent level, but then uses 4 tabs per indent level for each level after.\r\n- Whenever it used spaces, it only used one space.\r\n\r\nMaybe, it used spaces where it should have used tabs, and tabs where it should have used spaces?\r\nThis analysis was only conducted with the example config given. I didn't explore adding more config options.\n\n### Logs\n\n_No response_",[3162],{"name":3163,"color":3164},"pending triage","E99695",28038,"closed","Nonsensical formatting for nuxt.config.ts when accepting suggested compatibilityDate","2024-07-05T10:06:53Z","https://github.com/nuxt/nuxt/issues/28038",0.68457717,{"description":3172,"labels":3173,"number":3177,"owner":3152,"repository":3152,"state":3166,"title":3178,"updated_at":3179,"url":3180,"score":3181},"In my previous Vue projects I configured Webpack to run eslint with `--fix` option to autofix indent, spaces, etc.. but in Nuxt seems this option is missing.\r\n\r\nFor example, the followings are the `rules` is my `.eslintrc.js`\r\n``` js\r\nrules: {\r\n indent: ['error', 4],\r\n 'space-before-function-paren': ['error', 'never'],\r\n 'key-spacing': ['error', {\r\n beforeColon: true,\r\n afterColon: true,\r\n mode: 'minimum',\r\n align: {\r\n beforeColon: true,\r\n afterColon: true,\r\n on: 'colon'\r\n }\r\n }],\r\n semi: ['error', 'always'],\r\n 'keyword-spacing': ['error', {\r\n before: true,\r\n after: true\r\n }],\r\n 'brace-style': ['error', 'stroustrup']\r\n},\r\n```\r\nFor testing I change indentation in my `error.vue` to 2 spaces :\r\n``` js\r\nexport default {\r\n name : 'nuxt-error',\r\n props : ['error'],\r\n head() {\r\n return {\r\n title : this.error.message || 'An error occured'\r\n };\r\n }\r\n};\r\n```\r\nSo, if I use the `npm run lint` command (edited in `\"lint\": \"eslint --fix --ext .js,.vue --ignore-path .gitignore .\",`) all works fine, and the code now has 4 spaces indentation.\r\n\r\nBut if I use the `npm dev` command I have the following errors:\r\n``` \r\n 17:1 error Expected indentation of 4 spaces but found 2 indent\r\n 18:1 error Expected indentation of 4 spaces but found 2 indent\r\n 19:1 error Expected indentation of 4 spaces but found 2 indent\r\n 20:1 error Expected indentation of 8 spaces but found 4 indent\r\n 21:1 error Expected indentation of 12 spaces but found 6 indent\r\n 22:1 error Expected indentation of 8 spaces but found 4 indent\r\n 23:1 error Expected indentation of 4 spaces but found 2 indent\r\n\r\n✖ 7 problems (7 errors, 0 warnings)\r\n 7 errors, 0 warnings potentially fixable with the `--fix` option.\r\n```\r\n\r\nHow can I configure eslint in Nuxt commands to turn on the fix helper?\r\n\r\nThank you\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/c1453\">#c1453\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[3174],{"name":3175,"color":3176},"2.x","d4c5f9",1628,"Run eslint with --fix option","2023-01-18T15:42:01Z","https://github.com/nuxt/nuxt/issues/1628",0.708532,{"labels":3183,"number":3193,"owner":3152,"repository":3152,"state":3166,"title":3194,"updated_at":3195,"url":3196,"score":3197},[3184,3187,3190],{"name":3185,"color":3186},"3.x","29bc7f",{"name":3188,"color":3189},"bug","d73a4a",{"name":3191,"color":3192},"nitro","bfd4f2",11745,"Occasional corruption of `package.json` files in `.output/server` directory","2023-01-19T15:42:38Z","https://github.com/nuxt/nuxt/issues/11745",0.7292393,{"labels":3199,"number":3205,"owner":3152,"repository":3152,"state":3166,"title":3206,"updated_at":3207,"url":3208,"score":3209},[3200,3203,3204],{"name":3201,"color":3202},"stale","ffffff",{"name":3163,"color":3164},{"name":3175,"color":3176},8130,"Disable 'namespaced' in vuex when a module separated into files (actions.js, state.js and so on)","2023-01-22T15:38:17Z","https://github.com/nuxt/nuxt/issues/8130",0.7339925,{"description":3211,"labels":3212,"number":3215,"owner":3152,"repository":3152,"state":3166,"title":3216,"updated_at":3217,"url":3218,"score":3219},"### Version\n\n[v2.3.4](https://github.com/nuxt.js/releases/tag/v2.3.4)\n\n### Reproduction link\n\n[https://pastebin.com/CaNz3e05](https://pastebin.com/CaNz3e05)\n\n### Steps to reproduce\n\nyarn create nuxt-app \u003Cmy-project>\nin the process choose to activate prettier\n\n### What is expected ?\n\nhaving a working project\n\n### What is actually happening?\n\nan error is shown that the generated default page has wrong indentation - all script code has +1 indentation\n\n### Additional comments?\n\nRemoving 1 indentation level fixes the whole problem - so the fix is pretty easy, but, but the generated project code should be valid and not produce any errors.\n\n\u003C!--cmty-->\u003C!--cmty_prevent_hook-->\n\u003Cdiv align=\"right\">\u003Csub>\u003Cem>This bug report is available on \u003Ca href=\"https://cmty.app/nuxt\">Nuxt\u003C/a> community (\u003Ca href=\"https://cmty.app/nuxt/nuxt.js/issues/c8374\">#c8374\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[3213,3214],{"name":3163,"color":3164},{"name":3175,"color":3176},4644,"prettier complaining about the generated default.vue layout","2023-01-22T15:32:59Z","https://github.com/nuxt/nuxt/issues/4644",0.737786,{"description":3221,"labels":3222,"number":3224,"owner":3152,"repository":3152,"state":3166,"title":3225,"updated_at":3226,"url":3227,"score":3228},"按官网示例来完成第一个 Nuxt 示例. \r\n\r\n在运行阶段, 报N个错误, 先是 babel 找不到, 然后又是一系列组件找不到, 难到非得一个一个安装吗?\r\n\r\n即然都是依赖的必需组件, 为什么示例中的 package.json 中又没有依赖?\r\n\r\n运行环境: node: 6.9.4 npm: 3.1.0\r\n\r\n请教高手解决. 到底要运行 nuxt 示例需要哪些必备的依赖组件? 给个依赖列表出来, 谢谢\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/c269\">#c269\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[3223],{"name":3175,"color":3176},310,"第一次使用 Nuxt 坑太多","2023-01-18T15:38:47Z","https://github.com/nuxt/nuxt/issues/310",0.7395005,{"description":3230,"labels":3231,"number":3232,"owner":3152,"repository":3152,"state":3166,"title":3233,"updated_at":3234,"url":3235,"score":3236},"### Discussed in https://github.com/nuxt/nuxt/discussions/24686\r\n\r\n\u003Cdiv type='discussions-op-text'>\r\n\r\n\u003Csup>Originally posted by **SuleymanQ** December 11, 2023\u003C/sup>\r\n> ## How to downgrade nuxt in project or node_modules?\r\n\r\n### When nuxt running shows `3.8.2`\r\n\u003Cimg width=\"558\" alt=\"Screenshot 2023-12-11 at 16 49 25\" src=\"https://github.com/nuxt/nuxt/assets/104755033/036c2a56-fa5b-4639-93e0-70ff4d2d9375\">\r\n\r\n### But my package.json is `3.2.3`\r\n\u003Cimg width=\"316\" alt=\"Screenshot 2023-12-11 at 16 50 01\" src=\"https://github.com/nuxt/nuxt/assets/104755033/8145c1e3-6b52-41f2-b6ea-a7f3cd135ac8\">\r\n\r\n\r\n\u003C/div>\r\n```[tasklist]\r\n### Tasks\r\n```",[],24687,"Why nuxt is not same with package.json","2023-12-11T17:11:16Z","https://github.com/nuxt/nuxt/issues/24687",0.7400262,{"description":3238,"labels":3239,"number":3244,"owner":3152,"repository":3152,"state":3166,"title":3245,"updated_at":3246,"url":3247,"score":3248},"### What problem does this feature solve?\n\nCode is below:\n```js\n asyncData ({params, env}) {\n let html = '';\n if (process.server) {\n const marked = require('marked');\n const fs = require('fs');\n try {\n let markdown = fs.readFileSync(`./hello.md`, 'utf-8');\n html = marked(markdown);\n } catch(err) {\n console.log(\"[获取文件内容]:\", err)\n }\n }\n\n return { html`}\n }\n```\nI hope marked not be packed into client-side bundle when run nuxt generate, but it's in client-side bundle in fact\nHow to solve it?\n\n### What does the proposed changes look like?\n\nif a package is only used in server side , it should not be packaged into client-side\n\n\u003C!--cmty-->\u003C!--cmty_prevent_hook-->\n\u003Cdiv align=\"right\">\u003Csub>\u003Cem>This feature request is available on \u003Ca href=\"https://cmty.app/nuxt\">Nuxt\u003C/a> community (\u003Ca href=\"https://cmty.app/nuxt/nuxt.js/issues/c7422\">#c7422\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[3240,3243],{"name":3241,"color":3242},"enhancement","8DEF37",{"name":3175,"color":3176},3568,"How to avoid packing server-side js into client-side bundle js when use nuxt generate?","2023-01-22T15:50:41Z","https://github.com/nuxt/nuxt/issues/3568",0.74150836,{"labels":3250,"number":3252,"owner":3152,"repository":3152,"state":3166,"title":3253,"updated_at":3254,"url":3255,"score":3256},[3251],{"name":3185,"color":3186},12267,"Could not initiate the project","2023-01-19T16:03:00Z","https://github.com/nuxt/nuxt/issues/12267",0.74214166,["Reactive",3258],{},["Set"],["ShallowReactive",3261],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fnw-LvBLsvBuMruGhp2ObIjGSJM_DL03D-Y2kZDJo0gE":-1},"/nuxt/cli/1029"]