[NextJS] Static Build files are not found

shankytiwariTRIAL

a year 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[bot] 11 months ago


shankytiwariTRIAL

a year 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[bot] 11 months ago


a year ago

Is next build being ran during build?


Status changed to Awaiting User Response christian 11 months ago


shankytiwariTRIAL

a year ago

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


Status changed to Awaiting Railway Response railway[bot] 11 months ago


shankytiwariTRIAL

a year ago

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


a year ago

What is your build script?


shankytiwariTRIAL

a year 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 ?


a year ago

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


shankytiwariTRIAL

a year 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


a year ago

Try setting engines.node to 20


shankytiwariTRIAL

a year ago

Trying give me few mins!


shankytiwariTRIAL

a year ago

Sorry, where I do I add this setting ?


a year ago

package.json


shankytiwariTRIAL

a year ago

oh that, okay trying


shankytiwariTRIAL

a year ago

Build is in progress


a year ago

Is it now using node 20?


shankytiwariTRIAL

a year ago

Yes, I can see node_20 refer below image


shankytiwariTRIAL

a year ago

It is taking more than usual !


a year ago

What is? the build or the deploy?


shankytiwariTRIAL

a year 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.


a year ago

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


shankytiwariTRIAL

a year 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


a year 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.


shankytiwariTRIAL

a year ago

Makes sense, let me try


Status changed to Awaiting User Response christian 11 months ago


shankytiwariTRIAL

8 months ago

This ticket can be closed


Status changed to Awaiting Railway Response railway[bot] 8 months ago


8 months ago

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


Status changed to Awaiting User Response railway[bot] 8 months ago


Status changed to Solved christian 8 months ago


[NextJS] Static Build files are not found - Railway Help Station