Yedidya Rashi
Yedidya Rashi5mo ago

TypeError [ERR_INVALID_STATE]: Invalid state: Controller is already closed

I am getting this error
⨯ unhandledRejection: TypeError [ERR_INVALID_STATE]: Invalid state: Controller is already closed
at new NodeError (node:internal/errors:405:5)
at ReadableStreamDefaultController.enqueue (node:internal/webstreams/readablestream:1045:13)
at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/@trpc+server@11.0.0-rc.477/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/jsonl.mjs:72:31)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ERR_INVALID_STATE'
⨯ unhandledRejection: TypeError [ERR_INVALID_STATE]: Invalid state: Controller is already closed
at new NodeError (node:internal/errors:405:5)
at ReadableStreamDefaultController.enqueue (node:internal/webstreams/readablestream:1045:13)
at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/@trpc+server@11.0.0-rc.477/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/jsonl.mjs:72:31)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ERR_INVALID_STATE'
this is my env: I am using pnpm as my package manager
System:
OS: macOS 14.6.1
CPU: (12) arm64 Apple M2 Max
Memory: 12.19 GB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.20.2 - ~/.nvm/versions/node/v18.20.2/bin/node
Yarn: 1.22.22 - ~/Library/pnpm/yarn
npm: 10.7.0 - ~/.nvm/versions/node/v18.20.2/bin/npm
pnpm: 9.1.0 - ~/Library/pnpm/pnpm
Watchman: 2024.08.12.00 - /opt/homebrew/bin/watchman
Browsers:
Chrome: 128.0.6613.85
Safari: 17.6
npmPackages:
@tanstack/react-query: ^5.51.23 => 5.51.23
@trpc/client: 11.0.0-rc.477 => 11.0.0-rc.477+a467f8314
@trpc/react-query: 11.0.0-rc.477 => 11.0.0-rc.477+a467f8314
@trpc/server: 11.0.0-rc.477 => 11.0.0-rc.477+a467f8314
next: ^14.2.5 => 14.2.5
react: ^18.3.1 => 18.3.1
typescript: ^5.5.4 => 5.5.4
System:
OS: macOS 14.6.1
CPU: (12) arm64 Apple M2 Max
Memory: 12.19 GB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.20.2 - ~/.nvm/versions/node/v18.20.2/bin/node
Yarn: 1.22.22 - ~/Library/pnpm/yarn
npm: 10.7.0 - ~/.nvm/versions/node/v18.20.2/bin/npm
pnpm: 9.1.0 - ~/Library/pnpm/pnpm
Watchman: 2024.08.12.00 - /opt/homebrew/bin/watchman
Browsers:
Chrome: 128.0.6613.85
Safari: 17.6
npmPackages:
@tanstack/react-query: ^5.51.23 => 5.51.23
@trpc/client: 11.0.0-rc.477 => 11.0.0-rc.477+a467f8314
@trpc/react-query: 11.0.0-rc.477 => 11.0.0-rc.477+a467f8314
@trpc/server: 11.0.0-rc.477 => 11.0.0-rc.477+a467f8314
next: ^14.2.5 => 14.2.5
react: ^18.3.1 => 18.3.1
typescript: ^5.5.4 => 5.5.4
1 Reply
Yedidya Rashi
Yedidya RashiOP3mo ago
this is happaning in dev and prod Does someone get the same error?

Did you find this page helpful?