jordan
jordan
Explore posts from servers
CDCloudflare Developers
Created by jordan on 8/7/2024 in #pages-help
Remix and Vite - 2 error(s) and 0 warning(s) when compiling Worker.
I am trying to use pages for the first time and having an issue when trying to deploy. Working locally, everything works as expected but when building and running I get the error: 2 error(s) and 0 warning(s) when compiling Worker. This is for:
10:06:22.426 ✘ [ERROR] Could not resolve "crypto"
10:06:22.426
10:06:22.426 ../node_modules/cookie-signature/index.js:5:21:
10:06:22.426 ✘ [ERROR] Could not resolve "crypto"
10:06:22.426
10:06:22.426 ../node_modules/cookie-signature/index.js:5:21:
and:
10:06:22.428 ✘ [ERROR] Could not resolve "stream"
10:06:22.428
10:06:22.428 ../node_modules/stream-slice/index.js:3:24:
10:06:22.428 ✘ [ERROR] Could not resolve "stream"
10:06:22.428
10:06:22.428 ../node_modules/stream-slice/index.js:3:24:
I am using the template provided by Cloudflare, I have added the compatibility flag "nodejs_compat" and this is my dependencies:
"dependencies": {
"@heroicons/react": "^2.1.5",
"@prisma/client": "^5.17.0",
"@remix-run/cloudflare": "^2.10.3",
"@remix-run/cloudflare-pages": "^2.10.3",
"@remix-run/react": "^2.10.3",
"@tailwindcss/forms": "^0.5.7",
"bcryptjs": "^2.4.3",
"isbot": "^4.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"remix-auth": "^3.7.0",
"remix-auth-form": "^1.5.0"
},
"dependencies": {
"@heroicons/react": "^2.1.5",
"@prisma/client": "^5.17.0",
"@remix-run/cloudflare": "^2.10.3",
"@remix-run/cloudflare-pages": "^2.10.3",
"@remix-run/react": "^2.10.3",
"@tailwindcss/forms": "^0.5.7",
"bcryptjs": "^2.4.3",
"isbot": "^4.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"remix-auth": "^3.7.0",
"remix-auth-form": "^1.5.0"
},
I'm not sure how to fix this, as the guidance seems to be setting your compatibility flag, which I have done in wrangler.toml: compatibility_flags = [ "nodejs_compat" ] Any help would be appreciated!
5 replies
RRailway
Created by jordan on 4/19/2024 in #✋|help
Node server error but deployment worked
Hey, I'm learning a bit about web sockets and followed a tutorial and I wanted to deploy it to test how easy deploying would be as I want to build a proper app in future. Locally, it works fine running node server.js, but when I deployed it to railway, it errors when I go to the URL created with "Application failed to respond". In the deployment logs, it shows as successful and I am not sure what I have done wrong:
> node server.js

Listening on: http://localhost:8080
> node server.js

Listening on: http://localhost:8080
I'm not really sure what to look for to find out what is wrong.
7 replies
RRailway
Created by jordan on 8/28/2023 in #✋|help
Very slow connection
Hey, I've built an app that uses Remix, Prisma and Postgres and is hosted in vercel and railway. Locally, everything is fast, but when I have my app in production, it is really slow which majorly impacts the user experience. I just wanted to check if there is anything I can do to speed it up or if it is slow for any reason? It's my first time building an app using this stack and I don't know if I've maybe done something wrong or if it is location based?
9 replies
RRailway
Created by jordan on 4/9/2023 in #✋|help
API Development Advice
Hey, I don't know if this is the right place to ask but not sure where else to ask. I took over a website for a friend and they use an API that is severely limited (100 calls per 24 hours). All the results they get from the API are historic and never change. I wanted to develop an API to have a much higher request rate but keep the cost much lower. Could I do this using something like Node, Redis and PSQL? My background is mainly as a JS Frontend dev but I also have experience using clojure. I've worked on APIs but never developed one for production use. Any help and advice would be appreciated, and I'd prefer to host it using Railway as well as I love it so far
11 replies
RRailway
Created by jordan on 2/24/2023 in #✋|help
Strapi Heroku to Railway
Hey, I'm new to this side of development and have taken a website on to help a friend out. I'm trying to move their Admin site from Heroku to Railway but having a little trouble. I had the migration finished and everything working, then I realised I had an env variable that points to the heroku instance (postgres db). I removed the variable to check if it still works but got the following error:
strapi start [2023-02-24 12:04:13.309] debug: ⛔️ Server wasn't able to start properly. [2023-02-24 12:04:13.312] error: connect ECONNREFUSED 127.0.0.1:5432 Error: connect ECONNREFUSED 127.0.0.1:5432 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16)
Is there an easy way for me to expose this url? I tried following the docs https://docs.railway.app/databases/postgresql but I can't see where to find the variable DATABASE_URL. And lastly, once this is working, will I need to do a PG Dump from Heroku and PG Restore in Railway?
6 replies