Fetch fails on Node.js (WebAssembly error)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 15/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, nodejs, swift
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Swift
- Star
- 4k
- Fork
- 376
- Merge trung bình
- 1 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của thebaselab/codeapp
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
thebaselab/codeapp#1356 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
thebaselab/codeapp#1355 · 1 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
thebaselab/codeapp#1353 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
thebaselab/codeapp#1350 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
thebaselab/codeapp#1349 ·
Tất cả issue của thebaselab/codeapp
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
openwatersio/slackwater-ios#976 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
openwatersio/slackwater#591 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
compiler-explorer/compiler-explorer#9738 ·
Maintainer thường phản hồi trong vòng 2 ngày