Fetch fails on Node.js (WebAssembly error)
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 15/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, nodejs, swift
调研方向
The stack trace points into the bundled undici fetch implementation: lazyllhttp in lib/client.js throws WebAssembly is not defined, so the failure is in the Node runtime the app embeds, not in the Swift UI. Start by checking whether that runtime exposes a global WebAssembly object, then run the fetch snippet from the issue to reproduce. Done means await fetch(...) resolves on the device and the process exits without Ctrl+C.
由索引模型根据 Issue 内容生成。
描述
What Happened:
I was unable to use await fetch() nor fetch().then() on Node.js for this application.
Version this happens on:
The latest version available on the App Store & The Beta TestFlight
How to re-create
- Create a file called
test.js - Write down this code:
await fetch("https://jsonplaceholder.typicode.com/posts/1"); // Use any API
- Execute the file. You may need to allow ESM modules.
Error Dump
Solution 1 $ node /var/mobile/Containers/Data/Application/A3048ECB-6A9D-46F6-AC58-CDC31F18DB0B/Documents/node/Solutions/Solution 1/test.js
ReferenceError: WebAssembly is not defined
at lazyllhttp (node:internal/deps/undici/undici:7804:9)
at lib/client.js (node:internal/deps/undici/undici:7850:25)
at __require (node:internal/deps/undici/undici:6:50)
at lib/pool.js (node:internal/deps/undici/undici:9173:18)
at __require (node:internal/deps/undici/undici:6:50)
at lib/agent.js (node:internal/deps/undici/undici:9255:16)
at __require (node:internal/deps/undici/undici:6:50)
at lib/global.js (node:internal/deps/undici/undici:9376:17)
at __require (node:internal/deps/undici/undici:6:50)
at lib/fetch/index.js (node:internal/deps/undici/undici:9464:35)
TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11730:11)
at async file:///private/var/mobile/Containers/Data/Application/A3048ECB-6A9D-46F6-AC58-CDC31F18DB0B/Documents/node/Solutions/Solution%201/test.js:1:1 {
cause: ReferenceError: WebAssembly is not defined
at lazyllhttp (node:internal/deps/undici/undici:7804:9)
at lib/client.js (node:internal/deps/undici/undici:7850:25)
at __require (node:internal/deps/undici/undici:6:50)
at lib/pool.js (node:internal/deps/undici/undici:9173:18)
at __require (node:internal/deps/undici/undici:6:50)
at lib/agent.js (node:internal/deps/undici/undici:9255:16)
at __require (node:internal/deps/undici/undici:6:50)
at lib/global.js (node:internal/deps/undici/undici:9376:17)
at __require (node:internal/deps/undici/undici:6:50)
at lib/fetch/index.js (node:internal/deps/undici/undici:9464:35)
}
- The code will not execute properly. Depending on how it is written, it will either gracefully handle the
fetchor error out. - A pattern I discovered is that you had to press the
CTRL+Cto quit the application, meaning that Node.js doesn’t quit.
- 主要语言
- Swift
- 星标
- 4k
- 派生
- 376
- 平均合并
- 1 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
thebaselab/codeapp 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 35/100
thebaselab/codeapp#1356 ·
-
难度 3/5 1-2 天 新手友好度 52/100
thebaselab/codeapp#1355 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 45/100
thebaselab/codeapp#1353 ·
-
难度 4/5 3-5 天 新手友好度 48/100
thebaselab/codeapp#1350 ·
-
难度 4/5 3-5 天 新手友好度 42/100
thebaselab/codeapp#1349 ·
查看 thebaselab/codeapp 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
openwatersio/slackwater-ios#976 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
openwatersio/slackwater#591 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
compiler-explorer/compiler-explorer#9738 ·
维护者通常 2 天内回复