Error after deploying
d1hui
HOBBYOP

a year ago

hi, i do not know much about all the code, but it runs successfully on my computer but has this issue when i run through railway
is there a fix for this?

project id: a905169b-c3cb-4af1-a24e-5b5fac02d6cb

Solved

26 Replies

d1hui
HOBBYOP

a year ago

Starting Container

Error: Cannot find module '../config.json'

Require stack:

  • /usr/src/app/src/Logger.js

  • /usr/src/app/src/minecraft/handlers/ErrorHandler.js

  • /usr/src/app/src/minecraft/MinecraftManager.js

  • /usr/src/app/src/Application.js

  • /usr/src/app/index.js

    at Module._resolveFilename (node:internal/modules/cjs/loader:1149:15)

    at Module._load (node:internal/modules/cjs/loader:990:27)

    at Module.require (node:internal/modules/cjs/loader:1237:19)

    at require (node:internal/modules/helpers:176:18)

    at Object. (/usr/src/app/src/Logger.js:4:16)

    at Module._compile (node:internal/modules/cjs/loader:1378:14)

    at Module._extensions..js (node:internal/modules/cjs/loader:1437:10)

    at Module.load (node:internal/modules/cjs/loader:1212:32)

    at Module._load (node:internal/modules/cjs/loader:1028:12)

    at Module.require (node:internal/modules/cjs/loader:1237:19) {

    code: 'MODULENOTFOUND',

    requireStack: [

    '/usr/src/app/src/Logger.js',

    '/usr/src/app/src/minecraft/handlers/ErrorHandler.js',

    '/usr/src/app/src/minecraft/MinecraftManager.js',

    '/usr/src/app/src/Application.js',

    '/usr/src/app/index.js'

    ]

}


a year ago

Hi! What are you trying to deploy? could u explain it?


d1hui
HOBBYOP

a year ago

its a discord bot that connects a game chat to a discord channel


a year ago

Are you by any chance commiting your node_modules folder?


d1hui
HOBBYOP

a year ago

i think so


d1hui
HOBBYOP

a year ago

should i not be doing that?


a year ago

No!


d1hui
HOBBYOP

a year ago

ah


d1hui
HOBBYOP

a year ago

would i just need to remove the folder entirely


a year ago

also no


a year ago

how are you deploying it? by committing to a repo?


d1hui
HOBBYOP

a year ago

im using the cli


a year ago

do you have a .gitignore file in your project?


a year ago

at the root of it


d1hui
HOBBYOP

a year ago

yes


a year ago

paste the contents here please


d1hui
HOBBYOP

a year ago

actaully it does have the node_modules folder inside


d1hui
HOBBYOP

a year ago

node_modules/
.prettierrc.json
config.json
auth-cache/
logs/
data/


a year ago

ok, so the issue isn't what I thought it was


a year ago

are you sure this '../config.json' exists?


a year ago

because according to your gitignore, you're excluding it


d1hui
HOBBYOP

a year ago

oh yea thats weird it seems like all of the excluded things shouldnt be excluded


d1hui
HOBBYOP

a year ago

yea it works now i think tysm


a year ago

glad you could solve it! take a look at your framework docs to see why those files are ignored!


a year ago

I will close this thread for now, open a new one if you have any other issue


a year ago

!s


Status changed to Solved medim 11 months ago


Loading...