-
-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ts] Timeout when loading fgb files using takeAsync+deserialize starting with v3.27.3 #358
Comments
Thanks for the report and nice reproduction. I have noticed something similar and found it it happens only on node native fetch api. The tests in flatgeobuf works because it includes node-fetch polyfill (globally). I have as of yet no clue why it times out with node native fetch which is still marked as experimental. Because node native fetch is experimental I'm not sure how deep I want to dig at this time. That said, it's a nice find that it worked in 3.27.2, that means it likely has some relation to dependency upgrades done in 987499b and 6c0124c. Main suspect is web-streams-polyfill. |
That's helpful. I can confirm that polyfilling with node-fetch in the test file gets it to pass as you said.
|
Additional info on workaround, the polyfill code that node-fetch suggests on their github will not work because it only applies the fill if if (!globalThis.fetch) {
globalThis.fetch = fetch
globalThis.Headers = Headers
globalThis.Request = Request
globalThis.Response = Response
} to become if (globalThis) {
globalThis.fetch = fetch
globalThis.Headers = Headers
globalThis.Request = Request
globalThis.Response = Response
} |
When using flatgeobuf Javascript package version
3.27.3
and higher in a node v20.12.1 environment, I do not receive a response when loading a flatgeobuf from an external URL using deserialize + takeAsync.I can't tell exactly what is happening, it's not throwing an error for me, but I have reproduced the issue - https://github.com/twelch/flatgeobuf-error-demo/tree/main. see README for steps, the test (which is based on this internal fgb test) will timeout as-is and after downgrading to
3.27.2
it will pass.This seems to only occur when I am using the published library, adding this test to the internal flatgeobuf suite and it will pass/load just fine.
This seems to occur with any flatgeobuf loaded using this method, at least all of mine, not just this one published fgb, which is a simple polygon boundary for the world.
The text was updated successfully, but these errors were encountered: