What version of Next.js is supported for hosting in railway, what are the limitations?
I would like to use railway to host my next.js app. I would like to know if I can use latest Next.js, what features are not supported. eg : on demand ISR, SSG, SSR, Image optimizations, app dir.
Solution:Jump to solution
if you want ISR you have to write the code to do that yourself, railway won't do any of that for you
16 Replies
Project ID:
N/A
your code is ran as is, so if your code supports those features, then so will railway
there are some small limitations, but 8 times out of 10, it's up to your code
could you please tell me the limitations, I know aws amplify has
Supported features
Server-side rendered pages (SSR)
Static pages
API routes
Dynamic routes
Catch all routes
SSG (Static generation)
Incremental Static Regeneration (ISR)
Internationalized (i18n) sub-path routing
Internationalized (i18n) domain routing
Middleware
Environment variables
Image optimization.
Next.js 13 app directory
Unsupported features
Edge API Routes (Edge middleware is not supported)
On-Demand Incremental Static Regeneration (ISR)
Internationalized (i18n) automatic locale detection
idk if its the same for railway.app
Amplify support for Next.js SSR - AWS Amplify Hosting
Describes AWS Amplify deployment and hosting support for Next.js applications.
99% of those things are things you'd have to code to support yourself
no edge routes though
does On-Demand Incremental Static Regeneration (ISR) work?
your code is ran as is, so if you want ISR you'd have to code that yourself (or use someone else's code)
railway is purely an app runner, it doesn't do anything to your code
on demand ISR happens on the server side though, its a platform feature right? I would write the logic in my code but its executed in the server.
it might be a platform feature on something like vercel or netlify, but not on railway
Solution
if you want ISR you have to write the code to do that yourself, railway won't do any of that for you
I see, okey. Where is the hosting done. When i host apps in railway it just chooses its own region?? I would like mine to be closer to where im , could you tell me where i can change that
railway runs on gcp, and they currently only have one region available, us-west1
they are currently working on adding some more regions
Ohh that makes sense. Is there any limit for Hobby plan users. I sometimes feel like some operations on the DB are a bit slow. Is it due to the region or plan based limitation?
well it could be unoptimized code?, or your geographical location? on the hobby plan your databases and services each get their own dedicated resources (up to 8vcpu and 8 GB ram) so no limitations there to speak of
How to deploy docker projects on railway? is it also available for hobby users?
yep hobby users that are a part of beta
and you don't need to do anything special for access, just type forward slash beta here