R
Railway3mo ago
tochi

Delete Strapi build and .cache folders

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!
25 Replies
Percy
Percy3mo ago
Project ID: b5e8cf1d-aabc-407e-b35e-00c7b95d79c2
tochi
tochi3mo ago
b5e8cf1d-aabc-407e-b35e-00c7b95d79c2
Brody
Brody3mo 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
tochi
tochi3mo ago
ah that makes sense my issue is that im getting this error ReferenceError: CUSTOM_VARIABLES is not defined
tochi
tochi3mo 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
Strapi Community Forum
Use .env in local plugin
Unfortunately not, I would imagine you don’t want that API leaked in the build and it would be better in your case I think to construct an API controller in the plugin backend to handle the request and forward the response to your plugin frontend. If the key environment variable isn’t included during build time (of the admin and the plugin admi...
tochi
tochi3mo ago
No description
tochi
tochi3mo 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
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
Brody
Brody3mo ago
you are experiencing this issue locally right? since .env files do not come into play when on railway
tochi
tochi3mo ago
doesn't work locally and on production (same error message) hmm in that case is there a way to retrieve the env variables on the server?
Brody
Brody3mo ago
look at the service variables
tochi
tochi3mo ago
they work just fine i think this might jsut be a strapi issue
Brody
Brody3mo ago
no this wouldn't be a strapi nor railway issue, this would be due to some misconfigurations of your project
tochi
tochi3mo ago
i might have an idea then
tochi
tochi3mo ago
No description
tochi
tochi3mo ago
they said i should create a admin.config.js in the root of my project folder
Brody
Brody3mo ago
yep you definitely have some kind of misconfigurations going on
tochi
tochi3mo ago
think they meant inside the src folder then
Brody
Brody3mo ago
take a look at railway's strapi template for the correct folder structure
tochi
tochi3mo ago
alright checking now lmao im so blind so it should be inside the src folder ok will try to deploy the changes now well now i get an error saying webpack.DefinePlugin is not a constructor
tochi
tochi3mo ago
No description
tochi
tochi3mo ago
i debugged the webpack object to check if DefinePlugin exists in it
tochi
tochi3mo ago
and now i see that everything is inside webpack.default
Brody
Brody3mo 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?
tochi
tochi3mo ago
the probject is created from the strapi template x) but nah all good now this is the only issue i was facing 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(...
// this throws error saying webpack.DefinePlugin is not a constructor
new webpack.DefinePlugin(...

// this works
new webpack.default.DefinePlugin(...
thanks for the help!
Brody
Brody3mo ago
happy to hear that
Want results from more Discord servers?
Add your server
More Posts
Unable to add repository to service that I'm a collaborator onI'm a collaborator on a github repo, and I'm trying to deploy a service on railway using that repo. Deploy angular project on RailwayI have angular project which I can build and run on my local machine perfectly. here is the link of Issue when deploying Typebot templateLooks like something went wrong and the train derailed... Hello, I have tried deploying both TypeboBun + Next JS 14 + Dockerfile run build failed timed outHi! The run build crashes due to timeout, please look, what's wrong with this? Service ID 9783c8b7-cExtremely expensive by previous standardsI've been using Railway for more than a year and a half, and for the first time I've seen such nonseI am charged twice for the same BDI have double database since the migration, and I am being billed twice as much, I have several dataRailway projects suddenly failing with new "Cannot find type definition file for 'mime'" ErrorSeems that something changed in the Railway infra because even 'redeploying' previously working projWebdriver Exception:Process unexpectedly closed with status: 1I am using selenium 4.19.0, and Firefox as the webdriver with headless configuration. My code works I need help restoring the postgres dataI accidentally used prisma migrate and overwrote the data in my production database. Can someone fPayload CMS App Doesn't Appear to work correctlyI've got an app that works correctly localhost, but when I deploy to Railway, the only thing I get i