Delete Strapi build and .cache folders

AnonymousTRIAL

a year ago

Hello, how can I get a list of files in my railway project?

I tried the command railway run ls but it doens't recognize ls.

I would like to check if there's a build and .cache folder so i can delete them and then rebuild.

Please let me know if there's another way to achieve this, thanks!

Solved

0 Replies

AnonymousTRIAL

a year ago

b5e8cf1d-aabc-407e-b35e-00c7b95d79c2


a year ago

railway run runs the given command locally, there is no native way to run commands on the deployment.

if you want to check the files then check what files you have in your GitHub repo.

but please also describe the issue you are facing


Status changed to Solved railway[bot] about 1 year ago


AnonymousTRIAL

a year ago

ah that makes sense


AnonymousTRIAL

a year ago

my issue is that im getting this error ReferenceError: CUSTOM_VARIABLES is not defined


AnonymousTRIAL

a year ago

which is a common issue when trying to use .env in a local plugin in Strapi:
https://forum.strapi.io/t/use-env-in-local-plugin/992/7


AnonymousTRIAL

a year ago

1224442017040433400


AnonymousTRIAL

a year ago

this apparently should fix it but im not sure how to do it in my situation.. here's my github files lis:

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----        31-03-2024     17:43                .strapi
d-----        01-04-2024     20:44                admin
d-----        31-03-2024     17:43                database
d-----        31-03-2024     17:33                extensions
d-----        31-03-2024     17:33                public
d-----        31-03-2024     22:12                src
d-----        31-03-2024     17:43                types
-a----        23-01-2024     16:13            249 .editorconfig
-a----        23-01-2024     16:13             32 .eslintignore
-a----        23-01-2024     16:13            541 .eslintrc
-a----        23-01-2024     16:13           1157 .gitignore
-a----        01-04-2024     20:56             58 .strapi-updater.json
-a----        24-01-2024     00:05           3621 favicon.png
-a----        01-04-2024     16:42         721780 package-lock.json
-a----        01-04-2024     16:42           1278 package.json
-a----        30-01-2024     17:42           1867 README.md
-a----        01-04-2024     16:42         443254 yarn.lock

a year ago

you are experiencing this issue locally right? since .env files do not come into play when on railway


AnonymousTRIAL

a year ago

doesn't work locally and on production (same error message)


AnonymousTRIAL

a year ago

hmm in that case is there a way to retrieve the env variables on the server?


a year ago

look at the service variables


AnonymousTRIAL

a year ago

they work just fine


AnonymousTRIAL

a year ago

i think this might jsut be a strapi issue


a year ago

no this wouldn't be a strapi nor railway issue, this would be due to some misconfigurations of your project


AnonymousTRIAL

a year ago

i might have an idea then


AnonymousTRIAL

a year ago

1224443956612300800


AnonymousTRIAL

a year ago

they said i should create a admin.config.js in the root of my project folder


a year ago

yep you definitely have some kind of misconfigurations going on


AnonymousTRIAL

a year ago

think they meant inside the src folder then


a year ago

take a look at railway's strapi template for the correct folder structure


AnonymousTRIAL

a year ago

alright


AnonymousTRIAL

a year ago

checking now


AnonymousTRIAL

a year ago

lmao


AnonymousTRIAL

a year ago

im so blind


AnonymousTRIAL

a year ago

so it should be inside the src folder


AnonymousTRIAL

a year ago

ok will try to deploy the changes now


AnonymousTRIAL

a year ago

well now i get an error saying webpack.DefinePlugin is not a constructor


AnonymousTRIAL

a year ago

1224446773095960600


AnonymousTRIAL

a year ago

i debugged the webpack object to check if DefinePlugin exists in it

1224453320425603082


AnonymousTRIAL

a year ago

and now i see that everything is inside webpack.default


a year ago

would it be worth it to just deploy the strapi template and use that? it seems like you may have a few issues going on?


AnonymousTRIAL

a year ago

the probject is created from the strapi template x)


AnonymousTRIAL

a year ago

but nah all good now


AnonymousTRIAL

a year ago

this is the only issue i was facing


AnonymousTRIAL

a year ago

i don't get the errors anymore

// this throws error saying webpack.DefinePlugin is not a constructor
new webpack.DefinePlugin(...

// this works
new webpack.default.DefinePlugin(...

AnonymousTRIAL

a year ago

thanks for the help!


a year ago

happy to hear that