Nuxt 4.6.0 prompts to install `tailwindcss/nesting` when using pnpm
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 1-2 天
- 新手友好度
- 58/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- nuxt, tailwindcss, typescript
- 领域
- build-system
调研方向
Start by tracing where this module adds tailwindcss/nesting to Nuxt's PostCSS plugins, then inspect the Nuxt build behavior described in the report. Reproduce with Nuxt 4.6.0+, pnpm, and the documented module configuration; compare with Nuxt 4.5.2 if needed. Done means builds and generates no longer prompt to install the subpath when Tailwind CSS is installed.
由索引模型根据 Issue 内容生成。
描述
Environment
- **Nuxt Version:** `4.6.0` (with `future: { compatibilityVersion: 4 }`)
- **@nuxtjs/tailwindcss Version:** `^6.14.0` (or `6.x`)
- **Package Manager:** `pnpm` (tested on `12.x` / strict `node_modules`)
- **OS:** Linux
Reproduction
-
Create a Nuxt 4 project (or Nuxt with compatibilityVersion: 4 on nuxt@^4.6.0).
-
Install dependencies with pnpm:
pnpm add -D @nuxtjs/tailwindcss -
Add @nuxtjs/tailwindcss to modules in nuxt.config.ts.
-
Run pnpm run build or pnpm run generate.
Describe the bug
When running nuxt build or nuxt generate on Nuxt 4.6.0+ using pnpm, Nuxt halts execution and displays an interactive prompt asking to install tailwindcss/nesting:
❯ Do you want to install `tailwindcss/nesting`?
In CI/CD environments (or non-interactive shells), this causes the build to fail.
Additional context
- @nuxtjs/tailwindcss injects 'tailwindcss/nesting': {} into the PostCSS plugins by default.
- Starting in Nuxt 4.6.0, Nuxt's Vite builder introduced ensureDependencyInstalled(pluginName) to automatically detect missing PostCSS plugins and prompt the user to install them.
- Because 'tailwindcss/nesting' is a subpath export of the tailwindcss package rather than a standalone npm package, Nuxt fails to resolve it as an installed package—especially under pnpm's strict dependency isolation—mistakenly treating it as a missing dependency.
Expected Behavior
The build should complete without prompting to install tailwindcss/nesting, as tailwindcss is already installed and tailwindcss/nesting is part of it.
Current Workarounds
- Explicitly disable the plugin in nuxt.config.ts:
export default defineNuxtConfig({
postcss: {
plugins: {
'tailwindcss/nesting': false,
},
},
})
- Or pin Nuxt to version ~4.5.2.
Suggestions
• Check whether tailwindcss is already resolved before registering 'tailwindcss/nesting', or pass the resolved function reference instead of the string name.
• Alternatively, coordinate with the Nuxt core team regarding how ensureDependencyInstalled handles subpath imports in PostCSS plugin definitions.
- 主要语言
- TypeScript
- 星标
- 1.9k
- 派生
- 193
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nuxt-modules/tailwindcss 的其他 Issue
-
Version 6未关闭bug
难度 4/5 3-5 天 新手友好度 35/100
nuxt-modules/tailwindcss#1042 ·
-
bug
难度 3/5 1-2 天 新手友好度 35/100
nuxt-modules/tailwindcss#1039 · 2 条评论 ·
-
bug
难度 3/5 1-2 天 新手友好度 45/100
nuxt-modules/tailwindcss#1034 · 1 条评论 ·
-
bug
难度 3/5 1-2 天 新手友好度 35/100
nuxt-modules/tailwindcss#1033 · 1 条评论 ·
-
question
难度 3/5 1-2 天 新手友好度 30/100
nuxt-modules/tailwindcss#1031 · 7 条评论 ·
查看 nuxt-modules/tailwindcss 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 85/100
lukilabs/beautiful-mermaid#160 ·
-
难度 2/5 1-3 小时 新手友好度 66/100
rescript-lang/rescript-lang.org#1420 ·
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
chthollyphile/folia-major#520 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
databuddy-analytics/Databuddy#1106 ·
维护者通常 1 天内回复