Deployment Issue with Next.js (15.2.4) on Deno Deploy – dispatcher.getOwner is not a function
I'm encountering an issue when deploying my Next.js application (v15.2.4) on Deno Deploy. While the build and deployment processes complete successfully, accessing the deployed endpoint results in an Internal Server Error. The logs show the following repeated error:
[TypeError: dispatcher.getOwner is not a function] TypeError: Cannot read properties of undefined (reading 'clientModules') at eventLoopTick (ext:core/01_core.js:178:7)Important Notes: This error does not occur when running the project locally using npm run build && npm start. I have also tested deploying the same project on Render, where it works without issues. The problem only occurs after deployment when trying to access the application. Project Dependencies: Next.js: 15.2.4 React: 19.0.0 Tailwind CSS: ^4.0.17 PostCSS: ^8.4.9

4 Replies
From doing a google search it seems like this can happen when
NODE_ENV
isn't set properly, see https://github.com/remix-run/react-router/issues/12138 The error message makes it sound like the wrong variant of React is loadedThanks for the response! @marvinh. I’ll check my NODE_ENV settings and make sure the correct React build is being used.
Hey @marvinh.
I tried checking and updating the NODE_ENV settings, but unfortunately that didn’t resolve the issue. Let me know if there’s anything else I should look into.
I’m writing to follow up on an issue I previously raised regarding the deployment of my Next.js application (v15.2.4) on Deno Deploy. While the build and deployment steps complete without errors, accessing the deployed endpoint results in an Internal Server Error. The logs consistently show the following:
[TypeError: dispatcher.getOwner is not a function]
TypeError: Cannot read properties of undefined (reading 'clientModules')
at eventLoopTick (ext:core/01_core.js:178:7)
To clarify, this issue does not occur when running the project locally using npm run build && npm start, nor does it arise when deploying the same codebase to other platforms such as Render. The problem seems to be specific to the Deno Deploy environment.
I'm having the same problem, but I'm using Node and it should be an issue with Next.js.
This issue occurs during the pre-build page on server side
But I have no idea about how to fix that
Are you using the Pages instead of App router? I have a test that it's fine on App router but not Pages
I fixed this issue on my side just add
NODE_ENV=production
before start server command NODE_ENV=production node dist/server.js
Hey @Joey ,
Just to clarify — we’re currently using the App Router, not the Pages Router.
We also tried setting NODE_ENV=production, but unfortunately, it didn’t resolve the issue.
Additionally, it seems like you're working with a Node.js setup, whereas we're encountering this problem in a Next.js application.