Loading 3rd party scripts for unused widget
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 55/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- docker, gitlab, node.js, nuxt, typescript
- 领域
- build-system, devops
调研方向
通过 dist/module.mjs 追踪 bundler-transformer 的失败,尤其检查 downloadScript,并检查构建输出中显示的未使用的 dist/runtime/components/ScriptCalendlyInlineWidget.vue 条目。在受限网络环境中使用 npm run build 重现该失败。未使用的 widget 不触发第三方下载,而被引用的 widget 仍能加载其脚本,即表示完成。
由索引模型根据 Issue 内容生成。
描述
I run into an issue where loading a 3rd party widget fails in Gitlab job where the access to the internet is limited. The script that fails if used by a widget that is not used in the app at all. Would it be possible to not even load the 3rd party scripts if they are not referenced by the solution?
System:
@nuxt/scripts: 1.3.6
docker build in Gitlab actions
node:22.23.2
Here is the build output:
[@nuxt/scripts] ℹ Downloading script https://secure.gravatar.com/js/gprofiles.js → d1133547e8a1f280.js (21.38 kB br)
✓ 4471 modules transformed.
ERROR ✗ Build failed in 15.01s
│
■ Nuxt build error: Error: Build failed with 1 error:
│
│ [plugin nuxt:scripts:bundler-transformer] /src/src/MySolution/node_modules/@nuxt/scripts/dist/runtime/components/ScriptCalendlyInlineWidget.vue
│ FetchError: [GET] "https://assets.calendly.com/assets/external/widget.js": <no response> fetch failed
│ at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
│ at async $fetchRaw2 (file:///src/src/MySolution/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs:286:14)
│ at async $fetchRaw2 (file:///src/src/MySolution/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs:286:14)
│ at async $fetch2.$fetchRaw2 [as raw] (file:///src/src/MySolution/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs:286:14)
│ at async downloadScript (file:///src/src/MySolution/node_modules/@nuxt/scripts/dist/module.mjs:1137:11)
│ at async file:///src/src/MySolution/node_modules/@nuxt/scripts/dist/module.mjs:1382:40
│ at async TransformPluginContextImpl.handler (file:///src/src/MySolution/node_modules/@nuxt/scripts/dist/module.mjs:1451:13)
│ at async plugin (file:///src/src/MySolution/node_modules/rolldown/dist/shared/bindingify-input-options-COG1sboO.mjs:1537:16)
│ at async plugin.<computed> (file:///src/src/MySolution/node_modules/rolldown/dist/shared/bindingify-input-options-COG1sboO.mjs:2125:12)
│ Caused by:
│ TypeError: fetch failed
│ Caused by:
│ Error: read ECONNRESET
│ at TLSWrap.onStreamRead (node:internal/stream_base_commons:216:20)
ERROR: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1
- 主要语言
- TypeScript
- 星标
- 584
- 派生
- 91
- 平均合并
- 1 天 36 分钟
- 30 天内合并 PR
- 29
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nuxt/scripts 的其他 Issue
-
harlan-agent-wait-to-implement
难度 3/5 1-2 天 新手友好度 58/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 条评论 ·