Failed to lookup view "index" in views directory "/app/dist/views"
osdave
TRIALOP

a year ago

Yesterday morning I had a working albeit minimal version of my website running (deployment ID 2ae4a820-8614-4b6a-b100-94b9acee0b4f). After that I made a small change (i.e. adding handlebars partials) and deployed it again, but then got this error:

Failed to lookup view "index" in views directory "/app/dist/views"

I tried to fix it, and as I wasn't doing any progress I decided to deploy the code/commit I had earlier that was working but I got the same error. I tried changing the local node version to run the build command, but the error is always there.

The code is running fine on my machine.

The repo is here: https://github.com/OSdave/ateliers, the problematic service is "website"

Is there a was I can have a look at the container to get a better understanding?

What can I do to understand what I am doing wrong?

Let me know if you need nore info.

Solved

7 Replies

unicodeveloper
PRO

a year ago

It seems like you are running a monorepo. API and website and other things in the repo but you want it to only deploy what is in the website folder for the website service? Is that correct?


Status changed to Awaiting User Response Railway 12 months ago


osdave
TRIALOP

a year ago

Yes, that is absolutely correct. I cd into website and run npm run build, npm run copy-views and then railway up


Status changed to Awaiting Railway Response Railway 12 months ago


unicodeveloper
PRO

a year ago

Okay a better approach is making sure these commands run on Railway after you railway up

So go to your website service settings and add npm run build && npm run copy-views as a predeploy command.

So that when you run railway up, railway can also run these commands before deploying your app.

Attachments


Status changed to Awaiting User Response Railway 12 months ago


osdave
TRIALOP

a year ago

Thanks for that, I add that, I can see in the deploy logs that the commands are being executed but I still get the same error (cfr screenshot attached)

The commands are:

    "copy-views": "copyfiles -u 1 src/views/* src/views/**/* ./dist",
    "copy-public": "copyfiles -u 1 src/public/**/* ./dist",

Anything else I could do?


Status changed to Awaiting Railway Response Railway 12 months ago


unicodeveloper
PRO

a year ago

Please remove it from that section and add it to "Build" section. Let's see what happens.

Attachments


Status changed to Awaiting User Response Railway 12 months ago


osdave
TRIALOP

a year ago

YESS!!! it works perfectly now, thank you so much for your help :-)


Status changed to Awaiting Railway Response Railway 12 months ago


unicodeveloper
PRO

a year ago

Awesome! Glad to help


Status changed to Awaiting User Response Railway 12 months ago


Railway
BOT

6 months ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway 6 months ago


Loading...