Hi everyone, I got some problem with my last update for awesome-shaw-81f33a or staging.mybuddiestrip.com
I upgrade nextjs-plugin because i got this problem a lot.
Now it’s worst, if you visit https://staging.mybuddiestrip.com/ I got bad gateway.
I do have error in Function Next.js Server Handler.
I also work with mororepo.
Jun 11, 10:38:13 AM: a171467f TELEMETRY Name: netlify-observability-extension State: Already subscribed Types: [Platform, Function]Jun 11, 10:38:13 AM: a171467f 2024-06-11T14:38:13.776Z undefined ERROR Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"Error: Cannot find module 'next/dist/server/lib/start-server.js'\nRequire stack:\n- /var/task/.netlify/dist/run/next.cjs","reason":{"errorType":"Error","errorMessage":"Cannot find module 'next/dist/server/lib/start-server.js'\nRequire stack:\n- /var/task/.netlify/dist/run/next.cjs","code":"MODULE_NOT_FOUND","requireStack":["/var/task/.netlify/dist/run/next.cjs"],"stack":["Error: Cannot find module 'next/dist/server/lib/start-server.js'","Require stack:","- /var/task/.netlify/dist/run/next.cjs"," at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)"," at Module._load (node:internal/modules/cjs/loader:986:27)"," at Module.require (node:internal/modules/cjs/loader:1233:19)"," at require (node:internal/modules/helpers:179:18)"," at Object.<anonymous> (/var/task/.netlify/dist/run/next.cjs:498:30)"," at Module._compile (node:internal/modules/cjs/loader:1358:14)"," at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)"," at Module.load (node:internal/modules/cjs/loader:1208:32)"," at Module._load (node:internal/modules/cjs/loader:1024:12)"," at cjsLoader (node:internal/modules/esm/translators:348:17)"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: Error: Cannot find module 'next/dist/server/lib/start-server.js'","Require stack:","- /var/task/.netlify/dist/run/next.cjs"," at process.<anonymous> (file:///var/runtime/index.mjs:1276:17)"," at process.emit (node:events:519:28)"," at emit (node:internal/process/promises:150:20)"," at processPromiseRejections (node:internal/process/promises:284:27)"," at process.processTicksAndRejections (node:internal/process/task_queues:96:32)"]}Jun 11, 10:38:13 AM: a171467f EXTENSION Name: netlify-observability-extension State: Ready Events: [INVOKE, SHUTDOWN]Jun 11, 10:38:13 AM: a171467f INIT_REPORT Init Duration: 787.12 ms Phase: invoke Status: error Error Type: Runtime.UnhandledPromiseRejectionJun 11, 10:38:13 AM: a171467f Unknown application error occurredJun 11, 10:38:13 AM: a171467f Runtime.UnhandledPromiseRejectionJun 11, 10:38:13 AM: a171467f Duration: 961.75 ms Memory Usage: 46 MB
Here my root netlify.tom
[build]
command = "yarn build:v2"
publish = "client-v2/.next"
functions = "functions-build"
[dev]
command = "yarn dev:next"
port = 4040
functionsPort = 4050
BROWSER = "none"
[[plugins]]
package = "@netlify/plugin-nextjs"
[functions]
directory = "server/functions"
node_bundler = "esbuild"
external_node_modules = [
"mongoose",
"express",
"../lib/compress.js",
"../lib/utils.js",
"../lib/ast.js",
"../lib/transform.js",
"../lib/scope.js",
"../lib/parse.js",
"../lib/output.js",
"../lib/sourcemap.js",
"../lib/mozilla-ast.js",
"../lib/minify.js",
"../lib/propmangle.js",
"./exports.js",
"./templates/email-v2.html",
"uglify-js"
]
included_files = [
"./server/functions/templates/**",
"templates/**",
"./server/functions/modules/request-package/templates/email.html",
"./client-v2/.next/*.json"
]
[[headers]]
for = "/*"
[headers.values]
cache-control = '''
max-age=0,
no-cache,
no-store,
must-revalidate'''
[[redirects]]
from = "/assets/img/*"
to = "/assets/img/*"
status = 301
Here my nextjs app netlify.toml
command = "yarn build"
publish = ".next"
[[headers]]
# Define which paths this specific [[headers]] block will cover.
for = "/font/*"
[headers.values]
Access-Control-Allow-Origin = "*"
[[plugins]]
package = "@netlify/plugin-nextjs"
[functions]
included_files = [".next/*.json"]