[NextJS] Static Build files are not found
shankytiwari
TRIALOP

2 years ago

I have deployed my Next JS application Railway, the application is loading but few build files are not found for some reason.

Please refer below Image:

Note: The same application is working perfectly working file in Vercel.

Any idea whats wrong here ?

Solved

26 Replies

Hi Shashank,

It looks like your build completed and this got resolved? If you're still experiencing issues, please provide a link a deployment where you're experiencing this and we can investigate.

Regards, Christian


Status changed to Awaiting User Response Railway over 1 year ago


shankytiwari
TRIALOP

2 years ago

Hey christian, The build is completed but the issue is still there. I can't share the URL here at public forum unfortunately!


Status changed to Awaiting Railway Response Railway over 1 year ago


2 years ago

Is next build being ran during build?


Status changed to Awaiting User Response christian over 1 year ago


shankytiwari
TRIALOP

2 years ago

It ran properly, I did not see any error in the Build Logs


Status changed to Awaiting Railway Response Railway over 1 year ago


shankytiwari
TRIALOP

2 years ago

Most of the pages are working/loading perfectly fine, its just the one page where some build files are missing it seems!


2 years ago

What is your build script?


shankytiwari
TRIALOP

2 years ago

Its a very simple setup, here is my next.config.js and package.json,

  1. next.config.js:

    // next.config.js
    
    module.exports = {
      reactStrictMode: false,
      env: {
        API_BASE_URL: process.env.API_BASE_URL,
      },
    
      images: {
        unoptimized: true,
        domains: [
          "api.example.com",
        ],
      },
    };
  1. package.json:

    {
      "name": "some_app",
      "version": "0.1.0",
      "private": true,
      "scripts": {
        "dev": "next dev",
        "build": "next build",
        "start": "next start",
        "lint": "next lint"
      },
      "dependencies": {},
      "devDependencies": {}
    }

    Any extra config you need ?


2 years ago

What version of node is the build using and what version do you use locally?


shankytiwari
TRIALOP

2 years ago

Local:

  1. NodeJS Version: v20.10.0

  2. NextJS Version: 14.0.4

Railway:

  1. NodeJS Version: nodejs_18 (18)

  2. NextJS Version: 14.0.4


2 years ago

Try setting engines.node to 20


shankytiwari
TRIALOP

2 years ago

Trying give me few mins!


shankytiwari
TRIALOP

2 years ago

Sorry, where I do I add this setting ?


2 years ago

package.json


shankytiwari
TRIALOP

2 years ago

oh that, okay trying


shankytiwari
TRIALOP

2 years ago

Build is in progress


2 years ago

Is it now using node 20?


shankytiwari
TRIALOP

2 years ago

Yes, I can see node_20 refer below image


shankytiwari
TRIALOP

2 years ago

It is taking more than usual !monocle_face emoji


2 years ago

What is? the build or the deploy?


shankytiwari
TRIALOP

2 years ago

Okay, now its deployment is comepleted. But the same issue still there where most of the pages are working/loading perfectly fine, its just the one page where some build files are missing.


2 years ago

Have you tried researching the issue? this wouldn't be isolated to Railway.


shankytiwari
TRIALOP

2 years ago

I tried same thing in Vercel it worked there, hence I created a thread here. Thought you guys might have seem something similar to this before!

May be I can create build files locally and serve them via static server just to see if the build files are getting created in the first places!

Let me try and get back


2 years ago

Vercel develops next, I'm sure they have many workarounds for many misconfigurations so your apps always just work on their platform, but Railway only runs your project as-is, thats why I suggested researching the error.


shankytiwari
TRIALOP

2 years ago

Makes sense, let me try


Status changed to Awaiting User Response christian over 1 year ago


shankytiwari
TRIALOP

a year ago

This ticket can be closed


Status changed to Awaiting Railway Response Railway over 1 year ago


Thank you for the update. We'll close the thread.


Status changed to Awaiting User Response Railway over 1 year ago


Status changed to Solved christian over 1 year ago


Loading...