Deploy NextJS 14 + app router + public folder is missing

Hi, I want to deploy a nextJS 14 application with app router, deploy works fine with the new version of the plugin-nextjs (5.0.0-rc.4) but when trying to access the public folder is missing, it works fine with the plugin version 4.X.X.

setup

"next": "^14.1.0",
"@netlify/plugin-nextjs": "^5.0.0-rc.4",

netlify.toml

[[plugins]]
package = "@netlify/plugin-nextjs"

[build]
command = "npm run build:prod"
publish = "build"

[context.DEV]
command = "npm run build:dev"

[context.HIST]
command = "npm run build:hist"

[context.PROD]
command = "npm run build:prod"

[functions]

  [functions.___netlify-handler]
  included_files = [
    "./public/**"
  ]

  [functions."_api_*"]
  included_files = [
    "./public/**"
  ]

Thank you for your help

JM

The name of the function is ___netlify-server-handler, so the code should now be:

[functions]
  [functions.___netlify-server-handler]
    included_files = [
      "./public/**"
    ]

Though I’m not sure if you really wish to include the entire public folder in your function. If this is intended, feel free to make that change and it would work.

Hi hrishikesh, thanks for your answer

It didn’t work, in the plugin (v.4), it upload the public folder to the app’s root, I searched for it there, in the /server and /.netlify folder and couldn’t find it.

Do you know which manifest file use netlify-cli to know which files to upload? I was reading the plugin (4,5) source code but didn’t get where exactly this happen

I checked with the devs and you should be able to use

[functions]
  included_files = [
    "./public/**"
  ]

directly. Right now, you cannot specify a single function.