Undici v6 imported by @nuxt/scripts since v1.3.4
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 58/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- node.js, nuxtjs, typescript
调研方向
首先检查 @nuxt/scripts 的依赖设置以及相关 PR #860 和 #870,以确定 Undici v6 仍从哪里引入。确认移除该依赖不会破坏 @nuxt/scripts,并验证生产环境中的 Nuxt 服务器可以使用 Undici v8 而不会出现 interceptors.cache 错误。
由索引模型根据 Issue 内容生成。
描述
Undici v6 is imported by @nuxt/scripts since v1.3.4 at least up to v1.3.8.
In our case, it conflicts in some hidden way with our own import of undici v8, causing our nitro plugin for enabling the cache (inexistent in v6) to fail, failing our startup, but only on actual servers, not in dev mode.
import { setGlobalDispatcher, Agent, interceptors } from 'undici';
export default defineNitroPlugin(() => {
setGlobalDispatcher(new Agent().compose(interceptors.cache()));
});
=>
Application has thrown an uncaught exception and is terminated:
TypeError: interceptors.cache is not a function
at file:///D:/frontend/server/chunks/_/nitro.mjs:8221:18
at runNitroPlugins (file:///D:/XVRT/frontend/server/chunks/_/nitro.mjs:18122:7)
at file:///D:/frontend/server/chunks/_/nitro.mjs:18133:1
at ModuleJob.run (node:internal/modules/esm/module_job:439:25)
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
at async node:internal/modules/esm/loader:643:26
Workaround: add a package override to force undici v8 to be picked-up.
It seems a few PR have been done to cease bringing Undici through @nuxt/scripts, like #860 and #870. Is it possible to remove it entirely from @nuxt/scripts?
(I have tried a repro on Stackblitz, but I have been unable to repro on it or on a dev workstation.)
- 主要语言
- TypeScript
- 星标
- 584
- 派生
- 91
- 平均合并
- 1 天 36 分钟
- 30 天内合并 PR
- 29
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nuxt/scripts 的其他 Issue
-
harlan-agent-wait-to-implement
难度 4/5 3-5 天 新手友好度 55/100
-
harlan-agent-wait-to-implement
难度 5/5 一周以上 新手友好度 25/100
-
难度 4/5 3-5 天 新手友好度 10/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
mksglu/context-mode#1200 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
难度 2/5 1-3 小时 新手友好度 75/100
anthropics/claude-code#96687 ·
-
good first issue
难度 1/5 1 小时以内 新手友好度 95/100
AOSSIE-Org/DebateAI#582 · 2 条评论 ·