-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
Server crashes with error: Closed already requested. Readable stream is unavailable. #286
Comments
|
Can easily be reproduced with await new Promise((resolve) => setTimeout(resolve, 300)); at and pressing |
Tried to upgrade Deno ( Error stack changed:
|
Rarer error text:
|
I prepared minimal example with error reproduction: https://github.com/d9k/d9k-problems-examples/tree/main/deno/ultra/286-readable-stream-is-unavailable Please help |
Solved issue with auth code rewrite using useQuery() + After that error with multiple requests became
which doesn't lead to server crash. But the issue seems very disturbing. |
This is reproduced by simply adding asynchronous processing to the handler. import { createServer } from "ultra/server.ts";
const server = await createServer({
importMapPath: import.meta.resolve("./importMap.json"),
browserEntrypoint: import.meta.resolve("./client.tsx"),
});
function wait(ms: number): Promise<void> {
return new Promise<void>((resolve) => {
setTimeout(() => resolve(), ms);
});
}
function App() {
return <html></html>;
}
server.get("*", async () => {
await wait(200);
const result = await server.render(<App />);
return new Response(result, {
headers: {
"content-type": "text/html; charset=utf-8",
},
});
});
Deno.serve(server.fetch); So, this would also occur in a throw promise, using useQuery. There may be a fatal error in |
I have
await
for request inserver.get('*', async (context) => {
. atserver.tsx
.(I need to obtain Supabase session before SSR rendering start to do SSR routing correctly based on authenticated Supabase user permissions).
If I press
[F5]
key several times (< 7
) in browser then server breaks with errorCannot enqueue chunk when underlying stream is not readable. Readable stream is unavailable
. How to fix?!See
The text was updated successfully, but these errors were encountered: