Kevin
Kevin8mo ago

Deploy Next JS app on Deno Deploy

I have recently seen that it was possilbe to deploy a Next JS app on deno deploy so I wanted to give it a try with the last version of Next JS (14)... I have use the default project configuration
Install Step : npm install Build Step : npm run build Production Branch : main Entrypoint : https://deno.land/std@0.217.0/http/file_server.ts
And I have have added :
Root directory : .next/server/app
The build passed but when I connect to the homepage all assets are in 404, but I can load the index.html... Does anyone had this issue before ?
No description
1 Reply
Deno AI Helper
Deno AI Helper8mo ago
I wasn't able to find the answer to your question in the official Deno documentation. However, based on the information you've provided in your message, there are a couple of things that might be worth checking: 1. The entrypoint you're using (https://deno.land/std@0.217.0/http/file_server.ts) is a standard Deno file server, which serves static files from a given directory. It may not be suitable for serving a Next.js application, which typically requires a Node.js server environment to run server-side code and render pages dynamically. 2. The root directory you've specified (.next/server/app) seems to be pointing to a location that Next.js uses for its server-side generated files. However, Deno Deploy is not a Node.js environment, and as such, it may not be able to execute the server-side code generated by Next.js. Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of the advice given. For deploying a Next.js application, you would typically need a Node.js-compatible environment, and Deno Deploy is designed to run JavaScript and TypeScript code that is compatible with the Deno runtime. If you're looking to deploy a web application on Deno Deploy, you might want to consider using frameworks that are specifically designed for Deno, such as Fresh or Oak. These frameworks are built with Deno in mind and can be deployed directly to Deno Deploy without the need for a Node.js environment.