#No node entry point after `npm run build` in Next 15

27 messages · Page 1 of 1 (latest)

split rock
#

why isn't npm run build showing an entry point for next 15, it should be something like node .next/server.js or node .next/server/index.js or something. But the output is just:

 my-app git:(main) npm run build

> [email protected] build
> next build

   ▲ Next.js 15.0.2

   Creating an optimized production build ...
 ✓ Compiled successfully
 ✓ Linting and checking validity of types    
 ✓ Collecting page data    
 ✓ Generating static pages (5/5)
 ✓ Collecting build traces    
 ✓ Finalizing page optimization    

Route (app)                              Size     First Load JS
┌ ○ /                                    5.46 kB         105 kB
└ ○ /_not-found                          897 B           101 kB
+ First Load JS shared by all            99.7 kB
  ├ chunks/215-f207ea7968f9b6d8.js       45.2 kB
  ├ chunks/4bd1b696-23516f99b565b560.js  52.6 kB
  └ other shared chunks (total)          1.88 kB


○  (Static)  prerendered as static content

Where is my node

abstract heronBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

glad geyser
split rock
#

the plan is to run it on my machine locally it's a utility project for my personal use

glad geyser
#

yeah then just next start, if not, standalone output is still a feasible option, you have a server.js that you can simply node it

split rock
#

Where is it in Next 15?

split rock
glad geyser
#

are you using output: "standalone"?

split rock
#

I am not familiar with this setup.

glad geyser
#

go read the link i provided above

split rock
#

is it somewhere in docs?

#

ok, thanks. Do you know why it isn't default option?

glad geyser
#

well... i don't know, honestly. i'm not part of the team

split rock
#

ok, now I have the server.js file in .next/standalone/server.js but the image links and css is broken 😭 I run it via: node .next/standalone/server.js

split rock
#

Any idea how to fix that?

#

Why isn't server.js picking up the images and css?

glad geyser
#

to serve them you just need to copy .next/static to .next/standalone/.next/static

#

i just tested in a nextjs app i have and it works fine

ornate arch
split rock
glad geyser
#

if they are the images in public folder, you need to copy it to the standalone folder too for the same reason

#

Additionally, a minimal server.js file is also output which can be used instead of next start. This minimal server does not copy the public or .next/static folders by default as these should ideally be handled by a CDN instead, although these folders can be copied to the standalone/public and standalone/.next/static folders manually, after which server.js file will serve these automatically.

split rock