bundle-utils 11.x: `esbuild ^0.25.4` makes `npm install` (npm 12) fail with ERESOLVE next to Vite 8 (Nuxt UI 4.13 + @nuxtjs/i18n 10.7)

未关闭 适合新手
#677 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
79/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
node.js, nuxt, typescript, vite

调研方向

从依赖项仪表板 issue #304 中提到的 v11 Renovate 更新开始,并检查 @intlify/bundle-utils 中 esbuild 的版本范围。报告称,bundle-utils 仅对 JavaScript 和 TypeScript 资源使用 esbuild.transform。使用 npm 12 安装提供的复现项目来确认更改;当干净安装成功且 v11 依赖范围接受 esbuild 0.27 或 0.28 时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

Reporting a bug?

@intlify/bundle-utils 11.2.8 depends on esbuild: ^0.25.4. Vite 8.4 has the optional peer esbuild: ^0.27.0 || ^0.28.0.

So far another package usually put an esbuild 0.27 at the root of node_modules, and bundle-utils' 0.25 was nested below it. @nuxt/ui 4.13 moved to @nuxt/fonts 1.2, which no longer brings one. On npm 12, bundle-utils' esbuild 0.25.12 then ends up at the root, outside Vite's peer range, and a clean npm install fails with ERESOLVE. npm 10.8.2 still installs the same package.json: it puts esbuild 0.28.2 at the root and nests bundle-utils' 0.25.12.

Any Nuxt project with @nuxt/ui ≥ 4.13 and @nuxtjs/i18n hits this on npm 12. The chain is @nuxtjs/i18n 10.7.0 → @intlify/unplugin-vue-i18n ^11.2.8 → @intlify/bundle-utils 11.2.8 (exact).

npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error Found: [email protected]
npm error node_modules/esbuild
npm error   peerOptional esbuild@"*" from [email protected]
npm error   ...
npm error   esbuild@"^0.25.4" from @intlify/[email protected]
npm error   node_modules/@intlify/bundle-utils
npm error     @intlify/bundle-utils@"11.2.8" from @intlify/[email protected]
npm error     node_modules/@intlify/unplugin-vue-i18n
npm error       @intlify/unplugin-vue-i18n@"^11.2.8" from @nuxtjs/[email protected]
npm error
npm error Could not resolve dependency:
npm error peerOptional esbuild@"^0.27.0 || ^0.28.0" from [email protected]
npm error node_modules/vite
npm error   peer vite@"^5.2.0 || ^6 || ^7 || ^8" from @tailwindcss/[email protected]
npm error   ...
npm error
npm error Conflicting peer dependency: [email protected]
npm error node_modules/nitropack/node_modules/esbuild
npm error   peerOptional esbuild@"^0.27.0 || ^0.28.0" from [email protected]
Expected behavior

A clean npm install works on npm 12 too. bundle-utils only calls esbuild.transform(…, { loader: 'ts' }) for JS/TS resources, so raising the range should be safe.

The dependency dashboard (#304) already lists the Renovate update for the v11 line, "fix(deps): update dependency esbuild to ^0.28.0 (v11)" (renovate/v11-esbuild-0.x), but it hasn't been opened yet. Could that ship as an 11.2.x patch of @intlify/bundle-utils and @intlify/unplugin-vue-i18n, with esbuild: ^0.27.0 || ^0.28.0? @nuxtjs/i18n 10.x would pick it up through its ^11.2.8 range without a release of its own.

Reproduction

https://github.com/Tkkg1994/nuxt-ui-i18n-esbuild-eresolve

StackBlitz: https://stackblitz.com/github/Tkkg1994/nuxt-ui-i18n-esbuild-eresolve. Its terminal runs npx -y [email protected] install on start and ends in the ERESOLVE. StackBlitz's own npm 10.8.2 installs it, as npm 10 does locally.

{
  "dependencies": {
    "@nuxt/ui": "^4.13.1",
    "@nuxtjs/i18n": "^10.7.0",
    "nuxt": "^4.7.0"
  }
}
Setup Result
npm 12.2.3 ERESOLVE
npm 10.8.2 installs
npm 12, @nuxt/ui ~4.12.2 installs (esbuild 0.27.7 at the root via @nuxt/fonts 0.14 → fontless 0.2)
npm 12, without @nuxtjs/i18n installs
npm 12, "overrides": { "@intlify/bundle-utils": { "esbuild": "^0.27.0" } } installs, everything on esbuild 0.27.7
Issue Package

bundle-utils

System Info
node v24.22.3, npm 12.2.3, Windows 11
also in StackBlitz WebContainer: node v24.22.2, npm 12.2.3 via npx
nuxt 4.7.0, @nuxt/ui 4.13.1, @nuxtjs/i18n 10.7.0,
@intlify/unplugin-vue-i18n 11.2.8, @intlify/bundle-utils 11.2.8, vite 8.4.0
Screenshot

No response

Additional context

Workaround until a release:

"overrides": {
  "@intlify/bundle-utils": { "esbuild": "^0.27.0" }
}
Validations
  • Read the Contributing Guidelines.
  • Read the README
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A open a GitHub Discussion.
主要语言
TypeScript
星标
269
派生
46
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

intlify/bundle-tools 的其他 Issue

查看 intlify/bundle-tools 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。