Closed xInfinitYz closed 1 year ago
Hi @xInfinitYz, Thanks for sharing all the details.
engines
property.dependencies
and not the devDependencies
. So please check once that you don't need any packages from devDependencies
at the runtime. If you need any, please add them to dependencies instead.And for the AppInsight logs for the MODULE_NOT_FOUND
error:
Can you please check what are the other logs that came just before this and look for the details in the column which has code: 'MODULE_NOT_FOUND',, requireStack: [ '/home/site/wwwroot/next.config.js' ],}
Basically, the stack trace gets printed into multiple log lines, so you will get full stack trace if we look for the message in that column after sorting the logs by timestamp. There is probably another log with message like Error: Cannot find module .....
which would contain the actual missing module info.
Please try it out and let me know if it helps. Sorry for the inconvenience caused.
Hello @vivekjilla!
You were right, the problem was concretely a package missing that was in devDependencies. The moment you mentioned that there is a inner exception from next.config.js error, I already knew about which package it was.
The inner exception was the following:
[{"severityLevel":"Error","outerId":"0","message":"node exited with code 1 (0x1)","type":"Microsoft.Azure.WebJobs.Script.Workers.WorkerProcessExitException","id":"50971707"},{"severityLevel":"Error","outerId":"50971707","message":" ^,Error: Cannot find module '@next/bundle-analyzer'","type":"System.Exception","id":"14585677"}]
I've moved @next/bundle-analyzer
from devDependencies
towards dependencies
.
The app is running nicely now.
Cheers!
hi @vivekjilla - I am having the same issue that it returns 502, and in app insights I am getting
node exited with code 1 (0x1) code: 'MODULE_NOT_FOUND',, requireStack: [ '/home/site/wwwroot/next_function.js' ],}
However I can't seem to find/understand where to look for more of the error message as you write about above.
They all seem to have the same errors
Those errors might be related to why I get this:
and not why I can't load the page.
You can see my complete struggle here
I found this sample repo you have made @vivekjilla and adding this cp -r .next/standalone/apps/web/. .next/standalone
seems to have done the trick! Thank you!
Trying to deploy a NextJS 13 app with SSR.
Website is throwing 502.
Deployment log:
Application Insights Errors:
Weird exception code: 'MODULE_NOT_FOUND',, requireStack: [ '/home/site/wwwroot/next.config.js' ]
1/30/2023, 7:03:37.650 AM | System.Exception | System.Exception | Unknown | Unknown | Microsoft.Azure.WebJobs.Script.Workers.WorkerProcessExitException | node exited with code 1 (0x1) | | | System.Exception | code: 'MODULE_NOT_FOUND',, requireStack: [ '/home/site/wwwroot/next.config.js' ],} | 3 | [{"severityLevel":"Error","outerId":"0","message":"node exited with code 1 (0x1)","type":"Microsoft.Azure.WebJobs.Script.Workers.WorkerProcessExitException","id":"21495431"},{"severityLevel":"Error","outerId":"21495431","message":" code: 'MODULE_NOT_FOUND',, requireStack: [ '/home/site/wwwroot/next.config.js' ],}","type":"System.Exception","id":"27770329"}] | exception | {"LogLevel":"Error","ProcessId":"9023","FormattedMessage":"Language Worker Process exited. Pid=9092.","prop__{OriginalFormat}":"Language Worker Process exited. Pid=9092.","HostInstanceId":"0ffe7c62-1637-4898-97bb-6cc88a01b635","Category":"Worker.HttpWorkerProcess.26450880-567b-4a2a-82ee-0558cc8d2866"} | | | PC | 0.0.0.0
Trying to find python when using nodejs + nextjs ? I guess as fallback?
1/30/2023, 7:03:10.507 AM | System.NotSupportedException at Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcWorkerDescription.ValidateRuntimeVersion | System.NotSupportedException | Microsoft.Azure.WebJobs.Script, Version=4.15.0.0, Culture=neutral, PublicKeyToken=null | Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcWorkerDescription.ValidateRuntimeVersion | System.NotSupportedException | Version 3.6 is not supported for language python | Microsoft.Azure.WebJobs.Script, Version=4.15.0.0, Culture=neutral, PublicKeyToken=null | Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcWorkerDescription.ValidateRuntimeVersion | | | 3 | [{"severityLevel":"Error","outerId":"0","message":"Version 3.6 is not supported for language python","type":"System.NotSupportedException","id":"19386821","parsedStack":[{"assembly":"Microsoft.Azure.WebJobs.Script, Version=4.15.0.0, Culture=neutral, PublicKeyToken=null","method":"Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcWorkerDescription.ValidateRuntimeVersion","level":0,"line":150,"fileName":"/src/azure-functions-host/src/WebJobs.Script/Workers/Rpc/RpcWorkerDescription.cs"},{"assembly":"Microsoft.Azure.WebJobs.Script, Version=4.15.0.0, Culture=neutral, PublicKeyToken=null","method":"Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcWorkerDescription.ValidateDefaultWorkerPathFormatters","level":1,"line":126,"fileName":"/src/azure-functions-host/src/WebJobs.Script/Workers/Rpc/RpcWorkerDescription.cs"},{"assembly":"Microsoft.Azure.WebJobs.Script, Version=4.15.0.0, Culture=neutral, PublicKeyToken=null","method":"Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcWorkerDescription.FormatWorkerPathIfNeeded","level":2,"line":199,"fileName":"/src/azure-functions-host/src/WebJobs.Script/Workers/Rpc/RpcWorkerDescription.cs"},{"assembly":"Microsoft.Azure.WebJobs.Script, Version=4.15.0.0, Culture=neutral, PublicKeyToken=null","method":"Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcWorkerConfigFactory.AddProvider","level":3,"line":156,"fileName":"/src/azure-functions-host/src/WebJobs.Script/Workers/Rpc/Configuration/RpcWorkerConfigFactory.cs"}]}] | exception | {"LogLevel":"Error","prop__workerDir":"/azure-functions-host/workers/python","ProcessId":"9023","FormattedMessage":"Failed to initialize worker provider for: /azure-functions-host/workers/python","prop__{OriginalFormat}":"Failed to initialize worker provider for: {workerDir}","HostInstanceId":"a28c7f6f-31a4-4826-bb33-dcae87a4d7c7","Category":"Host.LanguageWorkerConfig"} | | | PC | 0.0.0.0 |
.env.production.local
next.config.js
staticwebapp.config.json
package.json