Next.js Discord

Discord Forum

File error in production

Answered
Weevil parasitoid posted this in #help-forum
Open in Discord
Weevil parasitoidOP
When deploying to production I get the following error
POST https://website.com 500 (Internal Server Error) and the file link to the error is this one: 9447-130a1a1fdbcc6d6b.js:1. This is generated inside the _next/static/chunks/94470-130a1a1fdbcc6d6b.js

You can see the error line in return n(I, L).then(function(t) {

Can someone help me with this? I've tried everything and don't know how to fix the problem.
Answered by Ray
you need to check the log on server not browser
View full answer

87 Replies

Weevil parasitoidOP
Any fix for this =(?
Or help
Weevil parasitoidOP
I'm using heroku, it's weird that I have to rollback to a previos version and everything works
But when I update to a new version this happens
Let me push the new version again and see the log
âš  No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache Attention: Next.js now collects completely anonymous telemetry regarding usage. This information is used to shape Next.js' roadmap and prioritize features. You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL: https://nextjs.org/telemetry â–² Next.js 14.1.3 Creating an optimized production build ... âš  Found lockfile missing swc dependencies, run next locally to automatically patch âš  For production Image Optimization with Next.js, the optional 'sharp' package is strongly recommended. Run 'npm i sharp', and Next.js will use it automatically for Image Optimization. Read more: https://nextjs.org/docs/messages/sharp-missing-in-production Compiler server unexpectedly exited with code: null and signal: SIGTERM âš  Found lockfile missing swc dependencies, run next locally to automatically patch âš  Found lockfile missing swc dependencies, run next locally to automatically patch
Then this is the error I get in the console
Weevil parasitoidOP
The website is built
But not connected to the server for some reason
And I see this red line in heroku didnt notice before
I can open it
@Ray I can open it
Weevil parasitoidOP
Right but something is messing the connection to the server and i saw that next file
That's why I was asking if there is something I'm missing in next
ok I saw the error from
https://onpointins.com/api/v1
Weevil parasitoidOP
Yup
do you see any log on the server?
Weevil parasitoidOP
you need to check the log on server not browser
Answer
Weevil parasitoidOP
Oh I just saw this page, I need to add error boundaries
Ohh omw
Myb
ES Modules error
Might be that one
@Weevil parasitoid Click to see attachment
do you use any package for this query?
getCarriers
@Ray do you use any package for this query?
Weevil parasitoidOP
Yeah
what is it?
Weevil parasitoidOP
It return the carriers
It's done in a resolver in Apollo
What I don't understand is why I keep getting this error in prod but not in dev
ah could you use ESM syntax for that
Weevil parasitoidOP
I'm looking how is ESM of this
@Weevil parasitoid I'm looking how is ESM of this
export default {
  Carries:{},
  Query: {
    getCarriers: () => ()
  },
}
Weevil parasitoidOP
Just wonder why it has been working like this and not it doesn't?
What changed?
what version were you using?
Weevil parasitoidOP
Of next ?
yes
Weevil parasitoidOP
14.0.3
Doing the push
I have no idea what change causing this, maybe you can find it in https://github.com/vercel/next.js/releases
Weevil parasitoidOP
Should I try updating to 14.1.4?
And test
Before changing to ESM
I think it will tell you to use ESM syntax too
you could try if you want to
Weevil parasitoidOP
Ok gonna try with ESM first then
Building
I just notice
That in prod it's using 14.1.3
Instead of 14.0.3
ah
how about now?
Weevil parasitoidOP
Building
Still
Well I'll change every function to use ESM
I just changed one to test
Weevil parasitoidOP
@Ray thanks mate! I just updated my local env to 14.1.3 and getting the error
Weevil parasitoidOP
Yeah but now the error is in dev
I'll do the changes and see
Do u recommend using 14.1.4?
Or I go for the 14.1.3?
Now I can see this
Niceee
@Weevil parasitoid Do u recommend using 14.1.4?
yes its better to use latest version if you can
Weevil parasitoidOP
Sounds good
so what version were you using locally?
Weevil parasitoidOP
14.0.3
And prod was using 14.1.3
oh ok
I always use ESM syntax so I have no idea when the things change lol
Weevil parasitoidOP
Yeah it's better using ESM
But this project is so old that i left it like that
Weevil parasitoidOP
This is correct in ESM?
Weevil parasitoidOP
Yeah making everything ESM makes Even more things to crash
There should be something that let me specify it inside next or tsfile
@Ray what is the error message now?
Weevil parasitoidOP
Got fixed
Was the ESM
oh ok