linear
linear
RRailway
Created by linear on 7/21/2024 in #✋|help
NextJS Deployment crashing with ERR_PNPM_NO_LOCKFILE
Project ID: 31d9b86c-db7f-44b7-8a2b-6d81ce651e2a Basically the same as https://help.railway.app/questions/deployment-of-next-js-project-has-suddenl-31fd443e and the other ERR_PNPM issue. My project is crashing with:
1.881  ERR_PNPM_NO_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is absent
1.881  ERR_PNPM_NO_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is absent
I have tried: ❌ Using pnpm v8 by having this in my package.json:
"packageManager": "[email protected]"
"packageManager": "[email protected]"
I actually never used v9. ❌ Using pnpm@latest as so:
"packageManager": "pnpm@latest"
"packageManager": "pnpm@latest"
This actually resulted in another error saying this format is invalid:
0.535 Usage Error: Invalid package manager specification in package.json (pnpm@latest); expected a semver version
0.535 Usage Error: Invalid package manager specification in package.json (pnpm@latest); expected a semver version
❌ Trying both the V2 and the Legacy runtime ❌ Deleting/Regenrating node_modules and pnpm-lock.yaml What can I do?
5 replies
RRailway
Created by linear on 3/10/2024 in #✋|help
How to change file browser volume?
No description
25 replies
RRailway
Created by linear on 12/24/2023 in #✋|help
How to make request using private networking?
I have two services and want to make a call from service A to service B using private networking. When I try to make a request, I get the error:
Mixed Content: The page at '[...]' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint '[...]'. This request has been blocked; the content must be served over HTTPS
Mixed Content: The page at '[...]' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint '[...]'. This request has been blocked; the content must be served over HTTPS
I'm using http as specified in the docs here. My request looks like this:
let url4 = "http://[service-name].railway.internal:8080/api/home";
axios
.post(url4)
.then((res) => {
const r = res.data;
alert(r["message"]);
})
.catch((err) => {
alert(url4 + err);
});
let url4 = "http://[service-name].railway.internal:8080/api/home";
axios
.post(url4)
.then((res) => {
const r = res.data;
alert(r["message"]);
})
.catch((err) => {
alert(url4 + err);
});
The request works when I make it via public networking. Project ID: 1031bd42-29fd-490d-aa39-3bffdaef2fb1
17 replies
RRailway
Created by linear on 12/23/2023 in #✋|help
How to fix 'Application failed to respond' error and add Python (flask) to Nextjs app on Railway?
Context/What I want to do: I have an app that uses nextjs and flask. I have the following folder structure:
/
├── .next
├── app
├── components
├── ...
├── server.py
└── ...
/
├── .next
├── app
├── components
├── ...
├── server.py
└── ...
and on start I want to run server.py and also npm start. What I'm doing Locally, I run python server.py to start the flask server and npm run build to build the static nextjs files for my app. On Railway, I entered python server.py && yarn start as the custom start command but then I get the "Application failed to respond" error on my page. When I remove the custom start command, Railway only runs yarn start and my page works again, but the Python flask server is not being started. From the docs (https://docs.railway.app/guides/fixing-common-errors) it looks like Railway is unable to connect to my app, but the only thing I changed is to alter the start command to python server.py && yarn start. The docs suggest to open the app on port 3000 which I tried with the command in the "What I tried" section. What I tried: - Changing the custom start command to python server.py && next start --port ${PORT-3000} as specified in the docs above - Using npm instead of yarn - Changing the folder structure (with the nextjs and the flask app separeted) - that didn't change anything, and Railway then didn't autodetect the languages and so running npm for example didn't work since npm was not available - Setting the custom build command to npm run --prefix .\client\ build and the custom start command to python server/server.py && npm run --prefix .\client\ start How can I fix this issue?
45 replies