emscripten-core / emscripten-core/emscripten

Uncaught TypeError: Cannot read properties of undefined (reading 'getAllResponseHeaders')

Open
#15,922 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

**Version of emscripten/emsdk:**
Please include the output `emcc -v` here

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.0.1 (5ebe1d421445fa9a4a02c1efc6d42bde3ac90da2)
clang version 14.0.0 (https://github.com/llvm/llvm-project d98dfb2baabb647a6ac4c4f4399999cfc44433db)
Target: wasm32-unknown-emscripten
Thread model: posix

Only after access to previously cached in Chrome browser(97.0.4692.71) results of previously fetched results of the http request to the same URL with flags EMSCRIPTEN_FETCH_LOAD_TO_MEMORY | EMSCRIPTEN_FETCH_PERSIST_FILE | EMSCRIPTEN_FETCH_APPEND and EMSCRIPTEN_FETCH_REPLACE | EMSCRIPTEN_FETCH_LOAD_TO_MEMORY from time to time(not 100% reproduce), while I call emscripten_fetch_get_response_headers_length I receiving runtime error like this:

index.js:5657 Uncaught TypeError: Cannot read properties of undefined (reading 'getAllResponseHeaders')
at __emscripten_fetch_get_response_headers_length (index.js:5657:47)
at ::emscripten_fetch_get_response_headers_length(emscripten_fetch_t *) (emscripten_fetch.cpp:247)
...

I have more than four fetch async operations to the remote http server at the same time(in parallel) and doesn't use webworkers and pthreads at all.
In all situation(downloaded form http or browser taken from the cache) received data is ok, status is ok, readyStatus is 4 and so on, problems only happens than I try to access to headers via emscripten_fetch_get_response_headers_length.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.