Fetch fails on Node.js (WebAssembly error)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 15/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, nodejs, swift
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Swift
- Stelle
- 4k
- Fork
- 376
- Merge medio
- 1m
- PR unite (30g)
- 1
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di thebaselab/codeapp
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
thebaselab/codeapp#1356 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
thebaselab/codeapp#1355 · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
thebaselab/codeapp#1353 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
thebaselab/codeapp#1350 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
thebaselab/codeapp#1349 ·
Tutte le issue di thebaselab/codeapp
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
openwatersio/slackwater-ios#976 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
openwatersio/slackwater#591 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
compiler-explorer/compiler-explorer#9738 ·
I maintainer di solito rispondono entro 2 giorni