Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Loading 3rd party scripts for unused widget

未关闭
#882 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
docker, gitlab, node.js, nuxt, typescript

调研方向

通过 dist/module.mjs 追踪 bundler-transformer 的失败,尤其检查 downloadScript,并检查构建输出中显示的未使用的 dist/runtime/components/ScriptCalendlyInlineWidget.vue 条目。在受限网络环境中使用 npm run build 重现该失败。未使用的 widget 不触发第三方下载,而被引用的 widget 仍能加载其脚本,即表示完成。

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

描述

harlan-agent-wait-to-implement

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

贡献指南

打开贡献指南

从这里开始

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

nuxt/scripts 的其他 Issue

查看 nuxt/scripts 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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