#Deploying storefront on private server issue

16 messages · Page 1 of 1 (latest)

celest tapir
#

So I deployed my nextjs storefront on my ubuntu private server but the problem when i run npm run build that it gives me

Error: Failed to collect page data for /404
    at /home/stackops/nextjs-starter-medusa/node_modules/next/dist/build/utils.js:916:15
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  type: 'Error'
}```
i think that because of not giving backend URL but i dont now where to config related env variables
crystal vault
celest tapir
#

@crystal vault I have to config it in .env.template, right?

crystal vault
celest tapir
#

@crystal vault , i passed actual backend url to NEXT_PUBLIC_MEDUSA_BACKEND_URL in .env.local but it seem like that it's not the correct problem because whenever i access http://my_ip_address:8000, i get this error

crystal vault
#

But this is nextjs in dev mode

#

Are you deploying this for production?

#

That error doesn't say much

#

What kind of browser do you use?

celest tapir
crystal vault
#

What node.js version do you have?

#

and Next.js version?

celest tapir
#

my node ver is v12.22.9 and next is next@12.3.4

crystal vault
#

Your issue is very old nodejs version which doesn't have javascript optional chaining or nullish coalescing feature

#

minimum is nodejs 14. That's even the minimum for nextjs 12