-
Notifications
You must be signed in to change notification settings - Fork 2
Package cannot find next/headers when deployed to production #5
Comments
Did you use pages router? |
No, I use the app router. |
Can you provide repo or example? |
Unfortunately, the repo for the project that I work on is private. However, I will make a new repo to hopefully reproduce it. |
Here is a repo that reproduces the issue: https://github.com/SerenModz21/isomorphic-next-reproduction |
By the way, not that this is to do with this issue, your typecasting for getAll is completely changing the actual return type. You're telling typescript to return a Record but it's an object array. For example: This can lead to confusion when people try to use |
I'll also check that issue. |
After having a proper look, I found that To resolve the type conflict, you could either have it return a union type or format one of the outputs to match the other. |
type definition issue has been resolved. Please check version 0.0.2. |
We are currently investigating the issue: Error: Cannot find module 'next/headers'. |
When I deploy my Next.js application to production, isomorphic-next fails to find
next/headers
:Versions:
next 14.2.13
isomorphic-next 0.0.1-Prerelease
I'm specifically stating that it isomorphic-next failing to find it because I use the cookies function from
next/headers
in parts of my codebase, to check if a cookie exists. That code works fine but when isomorphic-next tries to require it, it fails to find it.The only thing I can think of is that Next.js modifies
next/headers
imports at build time.If it's worth noting, I deploy my application using Docker and with a standalone build.
The text was updated successfully, but these errors were encountered: