Most active commenters
  • greyskull(3)

←back to thread

90 points vednig | 20 comments | | HN request time: 1.108s | source | bottom
1. Etheryte ◴[] No.42199068[source]
I haven't really followed Next.js and the related ecosystem closely, what does this project do exactly? If I look at Next.js docs [0], they have three options for self-hosting: using a Node server, using a Docker container or as an SPA. Is this project a wrapper around one of those or is it something else entirely? Or to perhaps ask differently, to me it seems you can already self-host Next.js, what's the value add of this specific project?

[0] https://nextjs.org/docs/pages/building-your-application/depl...

replies(6): >>42199156 #>>42199158 #>>42199207 #>>42199214 #>>42199340 #>>42200321 #
2. jeremy_k ◴[] No.42199156[source]
I believe the intent of OpenNext is to allow you to run your Next.js applications in a serverless manner, same as Vercel.
3. taikon ◴[] No.42199158[source]
The reason this project is important is because Next.js is hard to deploy if you're not using Vercel to host your app. You can easily run into issues that are hard to resolve. It's creates lock-in with Vercel and is one of the reasons why Vercel has a bad rep.
replies(1): >>42199253 #
4. grrowl ◴[] No.42199207[source]
You can "self-host" as in `next build` and `next serve`, but it runs as a monolothic runtime. Next-on-vercel compiles each api route to a serverless function and supports various additional flavours of server side rendering of pages. Open Next is being able to run like Next-on-vercel but on AWS, your own infra, Cloudflare Workers, and others.
replies(1): >>42200038 #
5. ◴[] No.42199214[source]
6. leerob ◴[] No.42199253[source]
(I work on Next.js)

The OpenNext project serves two purposes. First, it was to document some of the quirks when self-hosting Next.js. As of Next.js 15, the majority of these have been fixed, thanks to their feedback. The second is to provide an adapter for serverless Next.js deployments, similar to Vercel. Their adapter takes the Next.js output and transforms it to work in a serverless environment.

We're working with the maintainers of OpenNext to patch up some of the remaining quirks for deploying Next.js serverless and exploring how to make the maintenance of these community adapters easier.

If you want to self-host Next.js on a server, like a VPS or Node.js server, all features of Next.js are supported[1] and you do not need to use OpenNext. Our self-hosting docs include 10 example repos for deploying to different providers and a video walking through all features and options of Next[2].

[1]: https://nextjs.org/docs/app/building-your-application/deploy... [2]: https://www.youtube.com/watch?v=sIVL4JMqRfc

replies(2): >>42199752 #>>42200697 #
7. greyskull ◴[] No.42199340[source]
In the company I just left, I actually went through the process two or so months ago of migrating their Vercel deployment to AWS. I evaluated several options that are listed on the website and on GitHub, and we landed on using OpenNext via SST, it was a low-pain effort, especially given the CTO's desire to also migrate off of Next.js.

As other commenters have touched on - my understanding is the purpose of OpenNext is to package the output artifacts of a Next build in a way that can be deployed to a serverless environment, analogous to how Vercel does it. The supporting projects like SST and the other links in the repo are to take those OpenNext artifacts and deploy them to infrastructure generally in an opinionated way - additionally supporting some of the "extra" features described in the repository.

The last project I was working on was to then migrate from SST to Fargate, as a persistent process (serverful?) deployment was preferable for various reasons. In that scenario, we would just be running the built in server using the Next.js standalone deployment mode (effectively a `node index.js`). We didn't need the extra functionality covered by OpenNext.

replies(2): >>42199868 #>>42200238 #
8. atlex2 ◴[] No.42199752{3}[source]
Hello! On this topic: Could you please look into making the path ‘next/image’ uses for caching images user definable? Currently I can’t use Google app engine standard because the directory it uses is write protected. The only real solution seems to be custom image providers, which is a drag, so I’m on App Engine Flex spending way more than I probably should :-)
replies(1): >>42200016 #
9. kcrwfrd_ ◴[] No.42199868[source]
What’s the CTO’s motivation for migrating off of Next.js? And to what?
replies(2): >>42200927 #>>42202182 #
10. leerob ◴[] No.42200016{4}[source]
The way I would recommend handling this is using the `loaderFile`: https://nextjs.org/docs/app/api-reference/components/image#l...
11. dvnguyen ◴[] No.42200038[source]
Gotcha. That means if I run Next for just frontend + server side rendering stuff then I can always self host it?
replies(1): >>42200523 #
12. pier25 ◴[] No.42200238[source]
> especially given the CTO's desire to also migrate off of Next.js

To Remix?

replies(1): >>42200926 #
13. dawnerd ◴[] No.42200321[source]
Confused as well since we self host in docker and it's no different than any other node app. People keep posting that there's gotchas and weird setups but... it just works well for us.
replies(1): >>42200417 #
14. willio58 ◴[] No.42200417[source]
Ultimately what you’re doing is scalable for most use cases. You can even horizontally scale that setup on the fly to mimicking what you would get from using next in a serverless environment.
15. presentation ◴[] No.42200523{3}[source]
Sort of, so long as you don’t care about more complex hosting strategies eg hosting some/all of your server side code on edge servers when users visit your web app - as opposed to always sending them to a server in a set location in the world as a “normal” server architecture would typically do. Alongside not caring about prerendering and caching some pages and not others, that kind of thing
16. inlined ◴[] No.42200697{3}[source]
(I work on Firebase App Hosting, which also supports Next.js directly rather than OpenNext)

I want to +1 that Vercel has been really improving their portability. We still have Next.js specific code in Firebase, and having different architectures can sometimes make us have to figure out the best mapping of their features, but Vercel has made a noted effort to improve encapsulation of Vercel-specific features and portability has improved. I’m honestly surprised that OpenNext, which is not a new project, seems to have gained a lot of attention in the immediate past.

17. greyskull ◴[] No.42200926{3}[source]
Didn't get far enough along to understand the motivations and considered alternatives.
18. greyskull ◴[] No.42200927{3}[source]
Didn't get far enough along to understand the motivations and considered alternatives.
19. mdhb ◴[] No.42202182{3}[source]
Next is actively a bad stack run by an incredibly shady company would be a good start
replies(1): >>42202437 #
20. arez ◴[] No.42202437{4}[source]
bad stack in what way? Why is vercel shady? I can understand that the business model is questionable to lock-in people with developing a framework that runs best on their own cloud, but shady would mean fot me, that they do something illegal