TypeError [ERR_INVALID_STATE]: Invalid state: ReadableStream is already closed #55027
Replies: 20 comments 29 replies
-
Assuming that Can you provide a repro? |
Beta Was this translation helpful? Give feedback.
-
What Node.js version have you got? This looks like a stale stream object that's being reused. Like for example, if you'd do: const res = await fetch(/* something */)
cache.add('foo', res) And then called It is not really easy to see why this would happen on your snippet though. |
Beta Was this translation helpful? Give feedback.
-
for me it just happens if I'm on the dev server and reload the page really fast or do a hard reload ( |
Beta Was this translation helpful? Give feedback.
-
Trying to get together a simplified repo together in hopes it might help give better context to answering the question. Appreciate all the quick responses! 👍 |
Beta Was this translation helpful? Give feedback.
-
having the same issue on production build logs, not sure if its causing our crashes though. |
Beta Was this translation helpful? Give feedback.
-
I can now reproduce it everytime while running next.js app with Reproduce Error:
Ways To Stop The Error:
|
Beta Was this translation helpful? Give feedback.
-
I only see this when on next |
Beta Was this translation helpful? Give feedback.
-
Same issue. Reverting to 13.4.12 fixes the problem. |
Beta Was this translation helpful? Give feedback.
-
Same issue here. I'm not using any |
Beta Was this translation helpful? Give feedback.
-
Running into this same issue on "next": "^13.4.19", but not worth downgrading since I do not see any issues with my app. I am also using "next-auth": "^4.23.1", which seems a few others are as well, but probably not directly related. |
Beta Was this translation helpful? Give feedback.
-
I'm getting this error as well, and it is crashing my production server:
|
Beta Was this translation helpful? Give feedback.
-
Could people please answer these questions:
|
Beta Was this translation helpful? Give feedback.
-
I'm having the same errors and I'm not using Node: v18.16.0
|
Beta Was this translation helpful? Give feedback.
-
We just released Next.js 13.5, which contains over 438 bugs patched since 13.4. Can anyone please ensure you're using 13.5.x and try again? And if you're still experiencing issues, please answer the following:
Thank you! 🙏 |
Beta Was this translation helpful? Give feedback.
-
I am seeing this same error that @willianrod mentioned quite a bit using yarn dev with turbo repo.. I have seen this happen immediately after getting a memory exhaustion error. and when I run The next time it happens I'll get the data, but it seems to be a leak somewhere in the server. |
Beta Was this translation helpful? Give feedback.
-
Im getting the same error, from v13.4.19 and up to the latest release. As mentioned, it happens on a reload. |
Beta Was this translation helpful? Give feedback.
-
Should be fixed on React side Related: #55608 |
Beta Was this translation helpful? Give feedback.
-
Same issue here. Using Using supabase auth: |
Beta Was this translation helpful? Give feedback.
-
Any Update On this ? |
Beta Was this translation helpful? Give feedback.
-
I was getting this error with next 14.1.3 using app-router. I was getting this error when using the useTranslations hook from next-intl in an async component. Replacing the hook by the server-side await getTranslations function fixed the issue. Before solving (error occurs): export const ParagraphCaseStudy: FC<Props> = async ({ paragraph }) => {
const t = useTranslations();
} Solution: export const ParagraphCaseStudy: FC<Props> = async ({ paragraph }) => {
const t = await getTranslations();
} Not sure if this helps, but it seems it might have something to do with doing client stuff on server-components? |
Beta Was this translation helpful? Give feedback.
-
I am quickly throwing together a POC using Next.js new app router, and am making sequential api request in the layout file, and am getting the error
TypeError [ERR_INVALID_STATE]: Invalid state: ReadableStream is already closed
. Is this something to do with next.js cacheing? Curious if anyone has seen this error before and where I might start my efforts to fix.Code Snippet:
Beta Was this translation helpful? Give feedback.
All reactions