Next.js Discord

Discord Forum

Server responds in development but not in production

Answered
Silver Fox posted this in #help-forum
Open in Discord
Silver FoxOP
title.
Answered by joulev
write then use a database or vercel kv
View full answer

24 Replies

Silver FoxOP
basically the server is not working
im getting errors status 500
@Silver Fox im getting errors status 500
something should show up in the log
go to deployment => log
Silver FoxOP
ok
fix it
most likely an env var issue
Silver FoxOP
- error [Error: ENOENT: no such file or directory, open 'app/api/storage/servers.json'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'app/api/storage/servers.json'
}

I need to redo the paths?
what should I keep the paths as?
since it's json already i'd just import it
Silver FoxOP
I need to write too
import data from "./path/to/data.json"
@Silver Fox I need to write too
write then use a database or vercel kv
Answer
Silver FoxOP
any other hosting which work with fs?
any server-ful hosting will work with fs
your private server, digital ocean, render, fly.io, railway, etc
but they are not free
conventional hosting is always more expensive than serverless
Silver FoxOP
:((
Ill have to rewrite my backend
Silver FoxOP
time to setup firebase