Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure devops deployment succeeds, website returns 502 #1059

Closed
xInfinitYz opened this issue Jan 30, 2023 · 4 comments
Closed

Azure devops deployment succeeds, website returns 502 #1059

xInfinitYz opened this issue Jan 30, 2023 · 4 comments
Assignees

Comments

@xInfinitYz
Copy link

xInfinitYz commented Jan 30, 2023

Trying to deploy a NextJS 13 app with SSR.

Website is throwing 502.

Deployment log:

2023-01-30T08:15:03.1777888Z ##[section]Starting: Static Web App: 
2023-01-30T08:15:03.1786696Z ==============================================================================
2023-01-30T08:15:03.1787287Z Task         : Deploy Azure Static Web App
2023-01-30T08:15:03.1787467Z Description  : [PREVIEW] Build and deploy an Azure Static Web App
2023-01-30T08:15:03.1787675Z Version      : 0.208.0
2023-01-30T08:15:03.1787836Z Author       : Microsoft Corporation
2023-01-30T08:15:03.1788034Z Help         : https://aka.ms/swadocs
2023-01-30T08:15:03.1788179Z ==============================================================================
2023-01-30T08:15:03.5893893Z [command]/usr/bin/bash /home/vsts/work/_tasks/AzureStaticWebApp_18aad896-e191-4720-88d6-8ced4806941a/0.208.0/launch-docker.sh
2023-01-30T08:15:03.9854226Z stable: Pulling from appsvc/staticappsclient
2023-01-30T08:15:03.9856155Z 6aefca2dc61d: Pulling fs layer
2023-01-30T08:15:03.9857315Z 967757d56527: Pulling fs layer
2023-01-30T08:15:03.9858316Z c357e2c68cb3: Pulling fs layer
2023-01-30T08:15:03.9859491Z c766e27afb21: Pulling fs layer
2023-01-30T08:15:03.9860474Z d913781da675: Pulling fs layer
2023-01-30T08:15:03.9862712Z 54fa687f58b4: Pulling fs layer
2023-01-30T08:15:03.9864317Z c939a09b5983: Pulling fs layer
2023-01-30T08:15:03.9865608Z e198984d5536: Pulling fs layer
2023-01-30T08:15:03.9915064Z 21e57609d6b3: Pulling fs layer
2023-01-30T08:15:03.9915951Z c1881f2146e9: Pulling fs layer
2023-01-30T08:15:03.9916885Z 4bd05412a8e0: Pulling fs layer
2023-01-30T08:15:03.9917665Z 8146c9dfd394: Pulling fs layer
2023-01-30T08:15:03.9918514Z f0ffa7b9e9dc: Pulling fs layer
2023-01-30T08:15:03.9919062Z 1bdd8cf46ef0: Pulling fs layer
2023-01-30T08:15:03.9919636Z 4debd1ad733b: Pulling fs layer
2023-01-30T08:15:03.9920184Z a86c0ae94649: Pulling fs layer
2023-01-30T08:15:03.9921056Z 0042f3546c1c: Pulling fs layer
2023-01-30T08:15:03.9921812Z 90a4bb56beee: Pulling fs layer
2023-01-30T08:15:03.9922558Z c766e27afb21: Waiting
2023-01-30T08:15:03.9923159Z d913781da675: Waiting
2023-01-30T08:15:03.9923841Z 54fa687f58b4: Waiting
2023-01-30T08:15:03.9924539Z c939a09b5983: Waiting
2023-01-30T08:15:03.9924987Z e198984d5536: Waiting
2023-01-30T08:15:03.9925993Z 21e57609d6b3: Waiting
2023-01-30T08:15:03.9926538Z c1881f2146e9: Waiting
2023-01-30T08:15:03.9927009Z 4bd05412a8e0: Waiting
2023-01-30T08:15:03.9927290Z 8146c9dfd394: Waiting
2023-01-30T08:15:03.9927606Z f0ffa7b9e9dc: Waiting
2023-01-30T08:15:03.9927881Z 1bdd8cf46ef0: Waiting
2023-01-30T08:15:03.9928502Z 4debd1ad733b: Waiting
2023-01-30T08:15:03.9928783Z a86c0ae94649: Waiting
2023-01-30T08:15:03.9929040Z 0042f3546c1c: Waiting
2023-01-30T08:15:03.9929296Z 90a4bb56beee: Waiting
2023-01-30T08:15:04.1577664Z 967757d56527: Verifying Checksum
2023-01-30T08:15:04.1578071Z 967757d56527: Download complete
2023-01-30T08:15:04.2463672Z c357e2c68cb3: Verifying Checksum
2023-01-30T08:15:04.2464044Z c357e2c68cb3: Download complete
2023-01-30T08:15:04.9742472Z c766e27afb21: Verifying Checksum
2023-01-30T08:15:04.9742951Z c766e27afb21: Download complete
2023-01-30T08:15:05.1222484Z 6aefca2dc61d: Verifying Checksum
2023-01-30T08:15:05.1222950Z 6aefca2dc61d: Download complete
2023-01-30T08:15:05.2651162Z 54fa687f58b4: Verifying Checksum
2023-01-30T08:15:05.2655464Z 54fa687f58b4: Download complete
2023-01-30T08:15:05.3588583Z e198984d5536: Verifying Checksum
2023-01-30T08:15:05.3593728Z e198984d5536: Download complete
2023-01-30T08:15:05.4920434Z 21e57609d6b3: Verifying Checksum
2023-01-30T08:15:05.4928189Z 21e57609d6b3: Download complete
2023-01-30T08:15:05.5951385Z c1881f2146e9: Verifying Checksum
2023-01-30T08:15:05.5958191Z c1881f2146e9: Download complete
2023-01-30T08:15:05.7239272Z 4bd05412a8e0: Verifying Checksum
2023-01-30T08:15:05.7278771Z 4bd05412a8e0: Download complete
2023-01-30T08:15:06.2658607Z c939a09b5983: Verifying Checksum
2023-01-30T08:15:06.2664352Z c939a09b5983: Download complete
2023-01-30T08:15:06.4932870Z f0ffa7b9e9dc: Verifying Checksum
2023-01-30T08:15:06.4939325Z f0ffa7b9e9dc: Download complete
2023-01-30T08:15:06.5687704Z d913781da675: Verifying Checksum
2023-01-30T08:15:06.5688984Z d913781da675: Download complete
2023-01-30T08:15:07.4048108Z 4debd1ad733b: Verifying Checksum
2023-01-30T08:15:07.4048506Z 4debd1ad733b: Download complete
2023-01-30T08:15:07.4960261Z a86c0ae94649: Verifying Checksum
2023-01-30T08:15:07.4960627Z a86c0ae94649: Download complete
2023-01-30T08:15:07.6077803Z 1bdd8cf46ef0: Verifying Checksum
2023-01-30T08:15:07.6078192Z 1bdd8cf46ef0: Download complete
2023-01-30T08:15:07.6119643Z 0042f3546c1c: Verifying Checksum
2023-01-30T08:15:07.6143639Z 0042f3546c1c: Download complete
2023-01-30T08:15:07.6860008Z 90a4bb56beee: Verifying Checksum
2023-01-30T08:15:07.6860368Z 90a4bb56beee: Download complete
2023-01-30T08:15:08.8203355Z 6aefca2dc61d: Pull complete
2023-01-30T08:15:09.6860701Z 8146c9dfd394: Verifying Checksum
2023-01-30T08:15:09.6861100Z 8146c9dfd394: Download complete
2023-01-30T08:15:12.0337645Z 967757d56527: Pull complete
2023-01-30T08:15:12.4004402Z c357e2c68cb3: Pull complete
2023-01-30T08:15:15.5898906Z c766e27afb21: Pull complete
2023-01-30T08:15:22.2102833Z d913781da675: Pull complete
2023-01-30T08:15:22.7505212Z 54fa687f58b4: Pull complete
2023-01-30T08:15:25.0918826Z c939a09b5983: Pull complete
2023-01-30T08:15:25.1628719Z e198984d5536: Pull complete
2023-01-30T08:15:25.3019146Z 21e57609d6b3: Pull complete
2023-01-30T08:15:25.4164507Z c1881f2146e9: Pull complete
2023-01-30T08:15:25.5250819Z 4bd05412a8e0: Pull complete
2023-01-30T08:15:38.4971742Z 8146c9dfd394: Pull complete
2023-01-30T08:15:39.0740117Z f0ffa7b9e9dc: Pull complete
2023-01-30T08:15:43.8775098Z 1bdd8cf46ef0: Pull complete
2023-01-30T08:15:44.9299606Z 4debd1ad733b: Pull complete
2023-01-30T08:15:44.9926181Z a86c0ae94649: Pull complete
2023-01-30T08:15:45.0611676Z 0042f3546c1c: Pull complete
2023-01-30T08:15:45.1199562Z 90a4bb56beee: Pull complete
2023-01-30T08:15:45.1268595Z Digest: sha256:59770521cc6dd88ef2b858ca5b103a211801ccf714879955fe5e7ee40597a27d
2023-01-30T08:15:45.1295677Z Status: Downloaded newer image for mcr.microsoft.com/appsvc/staticappsclient:stable
2023-01-30T08:15:46.2164567Z DeploymentId: 607ce468-fe3e-4bbf-b01d-6cf1e3b6bc65
2023-01-30T08:15:46.2167399Z 
2023-01-30T08:15:46.3357552Z �[37mVerbose logging enabled�[0m
2023-01-30T08:15:46.3866668Z �[37mBuild timeout not specified, defaulting to 15 minutes�[0m
2023-01-30T08:15:46.3867610Z �[37mApp Directory Location: '/' was found.�[0m
2023-01-30T08:15:46.3868041Z �[37mconfig_file_location: config file '/staticwebapp.config.json' was found.�[0m
2023-01-30T08:15:46.3874883Z �[37mLooking for event info�[0m
2023-01-30T08:15:46.3898265Z �[37mEvent info parsed from action options.�[0m
2023-01-30T08:15:46.9405301Z �[37mStarting to build app with Oryx�[0m
2023-01-30T08:15:46.9406311Z �[33mAzure Static Web Apps utilizes Oryx to build both static applications and Azure Functions. You can find more details on Oryx here: https://github.com/microsoft/Oryx�[0m
2023-01-30T08:15:46.9407817Z �[37mCalling oryx build "/working_dir" -o /607ce468-fe3e-4bbf-b01d-6cf1e3b6bc65-swa-oryx/app --manifest-dir /607ce468-fe3e-4bbf-b01d-6cf1e3b6bc65-swa-oryx/app-manifest -p require_build -p disable_recursive_lookup=true -p ORYX_APP_TYPE="static-sites" -p NODE_DEFAULT_VERSION=16 -p DOTNET_DEFAULT_VERSION=6 -p PYTHON_DEFAULT_VERSION=3.9�[0m
2023-01-30T08:15:46.9408730Z �[37m---Oryx build logs---�[0m
2023-01-30T08:15:46.9409016Z �[37m�[0m
2023-01-30T08:15:46.9409242Z �[37m�[0m
2023-01-30T08:15:47.4750098Z �[37mOperation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx�[0m
2023-01-30T08:15:47.4759913Z �[37mYou can report issues at https://github.com/Microsoft/Oryx/issues�[0m
2023-01-30T08:15:47.4760434Z �[37m�[0m
2023-01-30T08:15:47.4760954Z �[37mOryx Version: 0.2.20221103.1, Commit: a2c65dde152b749fea395f4d1242ea9350942258, ReleaseTagName: 20221103.1�[0m
2023-01-30T08:15:47.4761350Z �[37m�[0m
2023-01-30T08:15:47.4761696Z �[37mBuild Operation ID: |HQmUreyBXoQ=.42f53b8d_�[0m
2023-01-30T08:15:47.4762134Z �[37mRepository Commit : 41554b998e7027a9b244a3def3b541e4fda91a3d�[0m
2023-01-30T08:15:47.4762449Z �[37m�[0m
2023-01-30T08:15:47.5028438Z �[37mDetecting platforms...�[0m
2023-01-30T08:15:49.4926884Z �[37mDetected following platforms:�[0m
2023-01-30T08:15:49.4933085Z �[37m  nodejs: 18.12.1�[0m
2023-01-30T08:15:49.4999879Z �[37mVersion '18.12.1' of platform 'nodejs' is not installed. Generating script to install it...�[0m
2023-01-30T08:15:49.5785766Z �[37mDetected the following frameworks: Typescript,Next.js�[0m
2023-01-30T08:15:49.7308541Z �[37m�[0m
2023-01-30T08:15:49.7406438Z �[37m�[0m
2023-01-30T08:15:49.7406829Z �[37mSource directory     : /working_dir�[0m
2023-01-30T08:15:49.7407333Z �[37mDestination directory: /607ce468-fe3e-4bbf-b01d-6cf1e3b6bc65-swa-oryx/app�[0m
2023-01-30T08:15:49.7407698Z �[37m�[0m
2023-01-30T08:15:49.7424872Z �[37m�[0m
2023-01-30T08:15:49.7425379Z �[37mDownloading and extracting 'nodejs' version '18.12.1' to '/opt/nodejs/18.12.1'...�[0m
2023-01-30T08:15:49.7463568Z �[37mDetected image debian flavor: bullseye.�[0m
2023-01-30T08:15:50.8027151Z �[37mDownloaded in 1 sec(s).�[0m
2023-01-30T08:15:50.8027622Z �[37mVerifying checksum...�[0m
2023-01-30T08:15:50.8118853Z �[37mExtracting contents...�[0m
2023-01-30T08:15:52.1246253Z �[37mperforming sha512 checksum for: nodejs...�[0m
2023-01-30T08:15:52.3165248Z �[37mDone in 3 sec(s).�[0m
2023-01-30T08:15:52.3165885Z �[37m�[0m
2023-01-30T08:15:52.3872481Z �[37mRemoving existing manifest file�[0m
2023-01-30T08:15:52.3932734Z �[37mCreating directory for command manifest file if it does not exist�[0m
2023-01-30T08:15:52.3990101Z �[37mCreating a manifest file...�[0m
2023-01-30T08:15:52.3994436Z �[37mNode Build Command Manifest file created.�[0m
2023-01-30T08:15:52.3997056Z �[37m�[0m
2023-01-30T08:15:52.4000633Z �[37mUsing Node version:�[0m
2023-01-30T08:15:52.4065171Z �[37mv18.12.1�[0m
2023-01-30T08:15:52.4085288Z �[37m�[0m
2023-01-30T08:15:52.4088474Z �[37mUsing Npm version:�[0m
2023-01-30T08:15:52.8059845Z �[37m8.19.2�[0m
2023-01-30T08:15:52.8160435Z �[37m�[0m
2023-01-30T08:15:52.8164011Z �[37mRunning 'npm install --unsafe-perm'...�[0m
2023-01-30T08:15:52.8166696Z �[37m�[0m
2023-01-30T08:16:46.3705870Z �[31mnpm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility�[0m
2023-01-30T08:17:05.1286877Z �[37m�[0m
2023-01-30T08:17:05.1314378Z �[37m> next-js-boilerplate@3.6.0 prepare�[0m
2023-01-30T08:17:05.1322835Z �[37m> husky install�[0m
2023-01-30T08:17:05.1329329Z �[37m�[0m
2023-01-30T08:17:05.2277515Z �[37mhusky - Git hooks installed�[0m
2023-01-30T08:17:05.2662755Z �[37m�[0m
2023-01-30T08:17:05.2678709Z �[37madded 1276 packages, and audited 1487 packages in 1m�[0m
2023-01-30T08:17:05.2700165Z �[37m�[0m
2023-01-30T08:17:05.2707300Z �[37m221 packages are looking for funding�[0m
2023-01-30T08:17:05.2707697Z �[37m  run `npm fund` for details�[0m
2023-01-30T08:17:05.2759814Z �[37m�[0m
2023-01-30T08:17:05.2760224Z �[37mfound 0 vulnerabilities�[0m
2023-01-30T08:17:05.3371160Z �[37m�[0m
2023-01-30T08:17:05.3381038Z �[37mRunning 'npm run build'...�[0m
2023-01-30T08:17:05.3437710Z �[37m�[0m
2023-01-30T08:17:05.7476118Z �[37m�[0m
2023-01-30T08:17:05.7480909Z �[37m> next-js-boilerplate@3.6.0 build�[0m
2023-01-30T08:17:05.7485127Z �[37m> next build�[0m
2023-01-30T08:17:05.7489142Z �[37m�[0m
2023-01-30T08:17:06.1312974Z �[37minfo  - Loaded env from /working_dir/.env.production.local�[0m
2023-01-30T08:17:06.1334909Z �[37minfo  - Loaded env from /working_dir/.env�[0m
2023-01-30T08:17:06.3049405Z �[37mwarn  - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache�[0m
2023-01-30T08:17:06.3318255Z �[37mAttention: Next.js now collects completely anonymous telemetry regarding usage.�[0m
2023-01-30T08:17:06.3322409Z �[37mThis information is used to shape Next.js' roadmap and prioritize features.�[0m
2023-01-30T08:17:06.3326508Z �[37mYou can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:�[0m
2023-01-30T08:17:06.3329989Z �[37mhttps://nextjs.org/telemetry�[0m
2023-01-30T08:17:06.3334183Z �[37m�[0m
2023-01-30T08:17:06.5011473Z �[37minfo  - Linting and checking validity of types...�[0m
2023-01-30T08:17:26.4352233Z �[37m�[0m
2023-01-30T08:17:26.4354555Z �[37m./src/components/agency/ProfileComponent.tsx�[0m
2023-01-30T08:17:26.4362544Z �[37m100:19  Warning: Classname 'bg-opacity-75' should be replaced by an opacity suffix (eg. '/75')  tailwindcss/migration-from-tailwind-2�[0m
2023-01-30T08:17:26.4363295Z �[37m�[0m
2023-01-30T08:17:26.4363661Z �[37m./src/core/components/filePreview.tsx�[0m
2023-01-30T08:17:26.4364204Z �[37m107:15  Warning: Classname 'wrapper' is not a Tailwind CSS class!  tailwindcss/no-custom-classname�[0m
2023-01-30T08:17:26.4364774Z �[37m�[0m
2023-01-30T08:17:26.4365519Z �[37minfo  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules�[0m
2023-01-30T08:17:26.4366063Z �[37minfo  - Creating an optimized production build...�[0m
2023-01-30T08:17:42.6380185Z �[37minfo  - Compiled successfully�[0m
2023-01-30T08:17:42.6417042Z �[37minfo  - Collecting page data...�[0m
2023-01-30T08:17:49.7219324Z �[37minfo  - Generating static pages (0/9)�[0m
2023-01-30T08:17:49.8572785Z �[37minfo  - Generating static pages (2/9)�[0m
2023-01-30T08:17:49.8724316Z �[37minfo  - Generating static pages (4/9)�[0m
2023-01-30T08:17:49.9082844Z �[37minfo  - Generating static pages (6/9)�[0m
2023-01-30T08:17:49.9262523Z �[37minfo  - Generating static pages (9/9)�[0m
2023-01-30T08:17:49.9400074Z �[37minfo  - Finalizing page optimization...�[0m
2023-01-30T08:17:49.9461635Z �[37m�[0m
2023-01-30T08:17:50.0001860Z �[37mRoute (pages)                              Size     First Load JS�[0m
2023-01-30T08:17:50.0003740Z �[37m┌ ○ /                                      431 B           107 kB�[0m
2023-01-30T08:17:50.0004917Z �[37m├   /_app                                  0 B            83.6 kB�[0m
2023-01-30T08:17:50.0005538Z �[37m├ ○ /404                                   181 B          83.7 kB�[0m
2023-01-30T08:17:50.0006890Z �[37m├ ○ /about                                 464 B           107 kB�[0m
2023-01-30T08:17:50.0007464Z �[37m├ ○ /agency                                4.78 kB         189 kB�[0m
2023-01-30T08:17:50.0007909Z �[37m├ λ /api/auth/[...nextauth]                0 B            83.6 kB�[0m
2023-01-30T08:17:50.0021590Z �[37m├ ○ /login                                 1.2 kB         84.8 kB�[0m
2023-01-30T08:17:50.0022855Z �[37m├ ○ /properties                            2.08 kB         130 kB�[0m
2023-01-30T08:17:50.0026040Z �[37m├ ○ /property                              197 B           186 kB�[0m
2023-01-30T08:17:50.0026533Z �[37m└ ○ /property/[propertyid]                 617 B           190 kB�[0m
2023-01-30T08:17:50.0027580Z �[37m+ First Load JS shared by all              90.1 kB�[0m
2023-01-30T08:17:50.0028537Z �[37m  ├ chunks/framework-114634acb84f8baa.js   45.4 kB�[0m
2023-01-30T08:17:50.0029117Z �[37m  ├ chunks/main-3c0f2a1ae62c4acb.js        27.1 kB�[0m
2023-01-30T08:17:50.0029613Z �[37m  ├ chunks/pages/_app-14a516abfea131a2.js  10.2 kB�[0m
2023-01-30T08:17:50.0030193Z �[37m  ├ chunks/webpack-ee7e63bc15b31913.js     815 B�[0m
2023-01-30T08:17:50.0030803Z �[37m  └ css/da6169150e392192.css               6.56 kB�[0m
2023-01-30T08:17:50.0031101Z �[37m�[0m
2023-01-30T08:17:50.0031441Z �[37mƒ Middleware                               61.9 kB�[0m
2023-01-30T08:17:50.0031747Z �[37m�[0m
2023-01-30T08:17:50.0039224Z �[37mλ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)�[0m
2023-01-30T08:17:50.0040219Z �[37m○  (Static)  automatically rendered as static HTML (uses no initial props)�[0m
2023-01-30T08:17:50.0040607Z �[37m�[0m
2023-01-30T08:17:50.3109146Z �[37m�[0m
2023-01-30T08:17:50.3116487Z �[37m> next-js-boilerplate@3.6.0 postbuild�[0m
2023-01-30T08:17:50.3123903Z �[37m> next-sitemap�[0m
2023-01-30T08:17:50.3130508Z �[37m�[0m
2023-01-30T08:17:50.4257825Z �[37mLoaded env from /working_dir/.env.production.local�[0m
2023-01-30T08:17:50.4264789Z �[37mLoaded env from /working_dir/.env�[0m
2023-01-30T08:17:50.4295124Z �[37m✨ [next-sitemap] Loading next-sitemap config: file:///working_dir/next-sitemap.config.js�[0m
2023-01-30T08:17:50.4371406Z �[37m✅ [next-sitemap] Generation completed�[0m
2023-01-30T08:17:50.4391787Z �[37m┌───────────────┬────────┐�[0m
2023-01-30T08:17:50.4397914Z �[37m│    (index)    │ Values │�[0m
2023-01-30T08:17:50.4398381Z �[37m├───────────────┼────────┤�[0m
2023-01-30T08:17:50.4398674Z �[37m│ indexSitemaps │   1    │�[0m
2023-01-30T08:17:50.4403224Z �[37m│   sitemaps    │   1    │�[0m
2023-01-30T08:17:50.4407410Z �[37m└───────────────┴────────┘�[0m
2023-01-30T08:17:50.4412131Z �[37m-----------------------------------------------------�[0m
2023-01-30T08:17:50.4412533Z �[37m SITEMAP INDICES �[0m
2023-01-30T08:17:50.4412900Z �[37m-----------------------------------------------------�[0m
2023-01-30T08:17:50.4418215Z �[37m�[0m
2023-01-30T08:17:50.4422488Z �[37m   ○ https://example.com/sitemap.xml�[0m
2023-01-30T08:17:50.4428264Z �[37m�[0m
2023-01-30T08:17:50.4432552Z �[37m�[0m
2023-01-30T08:17:50.4432934Z �[37m-----------------------------------------------------�[0m
2023-01-30T08:17:50.4437222Z �[37m SITEMAPS �[0m
2023-01-30T08:17:50.4441883Z �[37m-----------------------------------------------------�[0m
2023-01-30T08:17:50.4442238Z �[37m�[0m
2023-01-30T08:17:50.4442550Z �[37m   ○ https://example.com/sitemap-0.xml�[0m
2023-01-30T08:17:50.4442906Z �[37m�[0m
2023-01-30T08:17:50.4443123Z �[37m�[0m
2023-01-30T08:17:50.4622581Z �[37mPreparing output...�[0m
2023-01-30T08:17:50.4627978Z �[37m�[0m
2023-01-30T08:17:50.4632720Z �[37mCopying files to destination directory '/607ce468-fe3e-4bbf-b01d-6cf1e3b6bc65-swa-oryx/app'...�[0m
2023-01-30T08:17:55.5705277Z �[37mDone in 5 sec(s).�[0m
2023-01-30T08:17:55.5721261Z �[37m�[0m
2023-01-30T08:17:55.5721613Z �[37mRemoving existing manifest file�[0m
2023-01-30T08:17:55.5749853Z �[37mCreating a manifest file...�[0m
2023-01-30T08:17:55.5758201Z �[37mManifest file created.�[0m
2023-01-30T08:17:55.5764569Z �[37mCopying .ostype to manifest output directory.�[0m
2023-01-30T08:17:55.5771085Z �[37m�[0m
2023-01-30T08:17:55.5771412Z �[37mDone in 126 sec(s).�[0m
2023-01-30T08:17:56.6290935Z �[37m�[0m
2023-01-30T08:17:56.6295166Z �[37m�[0m
2023-01-30T08:17:56.6298914Z �[37m---End of Oryx build logs---�[0m
2023-01-30T08:17:56.6299703Z �[37mOryx build has completed. Took 129.6881669 seconds. Exit Code: 0�[0m
2023-01-30T08:17:56.6301478Z �[37mFound Oryx manifest file, checking for build location�[0m
2023-01-30T08:17:56.6302391Z �[37mFound Oryx build location: .next�[0m
2023-01-30T08:17:56.6303272Z �[37mOryx has determined that the app build artifacts are in the '.next' directory. If this is incorrect please specify the app artifact location.�[0m
2023-01-30T08:17:56.6304049Z �[37mFinished building app with Oryx�[0m
2023-01-30T08:17:56.6312287Z �[37mNo Api directory specified. Azure Functions will not be created.�[0m
2023-01-30T08:17:56.8853882Z �[33mWarning: For Next.js apps, staticwebapp.config.json features are not fully supported yet!�[0m
2023-01-30T08:17:56.8883079Z Created default file: /607ce468-fe3e-4bbf-b01d-6cf1e3b6bc65-swa-oryx/app/.next/index.html
2023-01-30T08:17:56.8950979Z �[37mDetermined default file to be: index.html�[0m
2023-01-30T08:17:56.8951540Z �[37mUsing 'staticwebapp.config.json' file for configuration information, 'routes.json' will be ignored.�[0m
2023-01-30T08:17:56.9014518Z �[37mCopying 'staticwebapp.config.json' to build output�[0m
2023-01-30T08:17:58.5315495Z �[37mStarting to build function app with Oryx�[0m
2023-01-30T08:17:58.5320674Z �[33mOryx will build function app with the following custom override command: rm -rf $SOURCE_DIR/node_modules/@next/swc-* && rm -rf $SOURCE_DIR/.next/cache�[0m
2023-01-30T08:17:58.5322520Z �[37mCalling oryx build "/607ce468-fe3e-4bbf-b01d-6cf1e3b6bc65-swa-oryx/app" -o /607ce468-fe3e-4bbf-b01d-6cf1e3b6bc65-swa-oryx/api --manifest-dir /607ce468-fe3e-4bbf-b01d-6cf1e3b6bc65-swa-oryx/api-manifest -p packagedir=.python_packages/lib/site-packages -p prune_dev_dependencies -p PLATFORM_NAME=nodejs -p NODE_VERSION=18�[0m
2023-01-30T08:17:58.5323963Z �[37m---Oryx build logs---�[0m
2023-01-30T08:17:58.5324428Z �[37m�[0m
2023-01-30T08:17:58.5324830Z �[37m�[0m
2023-01-30T08:17:59.0423711Z �[37mOperation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx�[0m
2023-01-30T08:17:59.0425285Z �[37mYou can report issues at https://github.com/Microsoft/Oryx/issues�[0m
2023-01-30T08:17:59.0427628Z �[37m�[0m
2023-01-30T08:17:59.0430559Z �[37mOryx Version: 0.2.20221103.1, Commit: a2c65dde152b749fea395f4d1242ea9350942258, ReleaseTagName: 20221103.1�[0m
2023-01-30T08:17:59.0432497Z �[37m�[0m
2023-01-30T08:17:59.0435121Z �[37mBuild Operation ID: |WMYnFoPik8w=.55faa198_�[0m
2023-01-30T08:17:59.0437039Z �[37m�[0m
2023-01-30T08:17:59.0817031Z �[37mDetecting platforms...�[0m
2023-01-30T08:18:01.1990666Z �[37mDetected following platforms:�[0m
2023-01-30T08:18:01.1991566Z �[37m  nodejs: 18.12.1�[0m
2023-01-30T08:18:01.2657313Z �[37mDetected the following frameworks: Next.js�[0m
2023-01-30T08:18:01.4095869Z �[37m�[0m
2023-01-30T08:18:01.4165679Z �[37m�[0m
2023-01-30T08:18:01.4172633Z �[37mSource directory     : /607ce468-fe3e-4bbf-b01d-6cf1e3b6bc65-swa-oryx/app�[0m
2023-01-30T08:18:01.4178885Z �[37mDestination directory: /607ce468-fe3e-4bbf-b01d-6cf1e3b6bc65-swa-oryx/api�[0m
2023-01-30T08:18:01.4179440Z �[37m�[0m
2023-01-30T08:18:01.4871229Z �[37mRemoving existing manifest file�[0m
2023-01-30T08:18:01.4879632Z �[37mCreating directory for command manifest file if it does not exist�[0m
2023-01-30T08:18:01.4915236Z �[37mCreating a manifest file...�[0m
2023-01-30T08:18:01.4925902Z �[37mNode Build Command Manifest file created.�[0m
2023-01-30T08:18:01.4932831Z �[37m�[0m
2023-01-30T08:18:01.4939089Z �[37mUsing Node version:�[0m
2023-01-30T08:18:01.4968916Z �[37mv18.12.1�[0m
2023-01-30T08:18:01.4978660Z �[37m�[0m
2023-01-30T08:18:01.4984742Z �[37mUsing Npm version:�[0m
2023-01-30T08:18:01.8801553Z �[37m8.19.2�[0m
2023-01-30T08:18:01.8984710Z �[37m�[0m
2023-01-30T08:18:01.8992215Z �[37mInstalling production dependencies in '/607ce468-fe3e-4bbf-b01d-6cf1e3b6bc65-swa-oryx/app/.oryx_prod_node_modules'...�[0m
2023-01-30T08:18:01.8999002Z �[37m�[0m
2023-01-30T08:18:01.9005807Z �[37mRunning 'npm install --unsafe-perm --production'...�[0m
2023-01-30T08:18:01.9011363Z �[37m�[0m
2023-01-30T08:18:02.2775034Z �[31mnpm WARN config production Use `--omit=dev` instead.�[0m
2023-01-30T08:18:13.9943651Z �[37m�[0m
2023-01-30T08:18:13.9954198Z �[37madded 192 packages, and audited 193 packages in 12s�[0m
2023-01-30T08:18:13.9960357Z �[37m�[0m
2023-01-30T08:18:13.9965793Z �[37m33 packages are looking for funding�[0m
2023-01-30T08:18:13.9971672Z �[37m  run `npm fund` for details�[0m
2023-01-30T08:18:13.9981965Z �[37m�[0m
2023-01-30T08:18:13.9986593Z �[37mfound 0 vulnerabilities�[0m
2023-01-30T08:18:14.0459652Z �[37m�[0m
2023-01-30T08:18:14.0467059Z �[37mCopying production dependencies from '/607ce468-fe3e-4bbf-b01d-6cf1e3b6bc65-swa-oryx/app/.oryx_prod_node_modules' to '/607ce468-fe3e-4bbf-b01d-6cf1e3b6bc65-swa-oryx/app/node_modules'...�[0m
2023-01-30T08:18:16.5348972Z �[37mDone in 2 sec(s).�[0m
2023-01-30T08:18:16.5385768Z �[37m�[0m
2023-01-30T08:18:16.5391019Z �[37mRunning 'npm install --unsafe-perm'...�[0m
2023-01-30T08:18:16.5395616Z �[37m�[0m
2023-01-30T08:18:19.8935640Z �[37m�[0m
2023-01-30T08:18:19.8944987Z �[37mchanged 21 packages, and audited 193 packages in 3s�[0m
2023-01-30T08:18:19.8951851Z �[37m�[0m
2023-01-30T08:18:19.8958398Z �[37m33 packages are looking for funding�[0m
2023-01-30T08:18:19.8964568Z �[37m  run `npm fund` for details�[0m
2023-01-30T08:18:19.8972371Z �[37m�[0m
2023-01-30T08:18:19.8979135Z �[37mfound 0 vulnerabilities�[0m
2023-01-30T08:18:19.9044365Z �[37m�[0m
2023-01-30T08:18:19.9493461Z �[37m�[0m
2023-01-30T08:18:19.9520989Z �[37mPreparing output...�[0m
2023-01-30T08:18:19.9529230Z �[37m�[0m
2023-01-30T08:18:19.9536538Z �[37mCopying files to destination directory '/607ce468-fe3e-4bbf-b01d-6cf1e3b6bc65-swa-oryx/api'...�[0m
2023-01-30T08:18:22.2552683Z �[37mDone in 2 sec(s).�[0m
2023-01-30T08:18:22.2554012Z �[37m�[0m
2023-01-30T08:18:22.2554347Z �[37mRemoving existing manifest file�[0m
2023-01-30T08:18:22.2554742Z �[37mCreating a manifest file...�[0m
2023-01-30T08:18:22.2555107Z �[37mManifest file created.�[0m
2023-01-30T08:18:22.2555530Z �[37mCopying .ostype to manifest output directory.�[0m
2023-01-30T08:18:22.2555856Z �[37m�[0m
2023-01-30T08:18:22.2556143Z �[37mDone in 20 sec(s).�[0m
2023-01-30T08:18:22.9297318Z �[37m�[0m
2023-01-30T08:18:22.9300094Z �[37m�[0m
2023-01-30T08:18:22.9300494Z �[37m---End of Oryx build logs---�[0m
2023-01-30T08:18:22.9302151Z �[37mOryx build has completed. Took 24.3964941 seconds. Exit Code: 0�[0m
2023-01-30T08:18:22.9302704Z �[33mFunction Runtime Information. OS: linux, Functions Runtime: ~4, node version: 18�[0m
2023-01-30T08:18:22.9303181Z �[37mFinished building function app with Oryx�[0m
2023-01-30T08:18:24.0908366Z �[37mZipping Api Artifacts�[0m
2023-01-30T08:18:24.0909960Z �[37mApi Zip will be created from directory: /607ce468-fe3e-4bbf-b01d-6cf1e3b6bc65-swa-oryx/api�[0m
2023-01-30T08:18:24.0910817Z �[37mApi Content Hash: cdd77f96ed3d6d2a2fa2658766716bdf�[0m
2023-01-30T08:18:32.8902362Z �[37mDone Zipping Api Artifacts�[0m
2023-01-30T08:18:33.1264369Z �[37mZipping App Artifacts�[0m
2023-01-30T08:18:33.1265071Z �[37mApp Zip will be created from directory: /tmp/jigf0gxz.wz3�[0m
2023-01-30T08:18:33.1270322Z �[37mDone Zipping App Artifacts�[0m
2023-01-30T08:18:33.1275285Z �[37mUploading build artifacts.�[0m
2023-01-30T08:18:34.2452304Z �[32mFinished Upload. Polling on deployment.�[0m
2023-01-30T08:18:34.3758752Z �[37mStatus: InProgress. Time: 0.1307205(s)�[0m
2023-01-30T08:18:49.4208539Z �[37mStatus: InProgress. Time: 15.1753778(s)�[0m
2023-01-30T08:19:04.4520241Z �[37mStatus: InProgress. Time: 30.2060651(s)�[0m
2023-01-30T08:19:19.6198157Z �[37mStatus: Succeeded. Time: 45.3719784(s)�[0m
2023-01-30T08:19:19.6199028Z �[32mDeployment Complete :)�[0m
2023-01-30T08:19:19.6199509Z �[32mVisit your site at: https://white-water-022b4e403.2.azurestaticapps.net�[0m
2023-01-30T08:19:19.6450895Z �[37mThanks for using Azure Static Web Apps!�[0m
2023-01-30T08:19:19.6452825Z �[37mExiting�[0m
2023-01-30T08:19:19.9462654Z ##[section]Finishing: Static Web App: 

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

AZURE_AD_B2C_TENANT_NAME=x
AZURE_AD_B2C_TENANT_ID=x
AZURE_AD_B2C_CLIENT_ID=x
AZURE_AD_B2C_CLIENT_SECRET=x
AZURE_AD_B2C_PRIMARY_USER_FLOW=x
AZURE_AD_B2C_LOGOUT_URL=x
AZURE_AD_B2C_TOKEN_ENDPOINT=x
NEXTAUTH_SECRET=x
NEXTAUTH_URL=x
PAGE_URL=x
REACT_APP_APPINSIGHTS_KEY=x
NEXT_PUBLIC_AGENCY_COMPONENT_API_URL=x
NEXT_PUBLIC_AGENCY_COMPONENT_API_KEY=x
NEXT_PUBLIC_PROPERTY_COMPONENT_API_URL=x
NEXT_PUBLIC_PROPERTY_COMPONENT_API_KEY=x

next.config.js

/* eslint-disable import/no-extraneous-dependencies */
const withBundleAnalyzer = require('@next/bundle-analyzer')({
  enabled: process.env.ANALYZE === 'true',
});

module.exports = withBundleAnalyzer({
  eslint: {
    dirs: ['.'],
  },
  images: {
    domains: ['x.blob.core.windows.net', 'tailwindui.com'],
    formats: ['image/webp'],
    loader: 'imgix',
    path: '/',
  },
  env: {
    AZURE_AD_B2C_TENANT_NAME: process.env.AZURE_AD_B2C_TENANT_NAME,
    AZURE_AD_B2C_TENANT_ID: process.env.AZURE_AD_B2C_TENANT_ID,
    AZURE_AD_B2C_CLIENT_ID: process.env.AZURE_AD_B2C_CLIENT_ID,
    AZURE_AD_B2C_CLIENT_SECRET: process.env.AZURE_AD_B2C_CLIENT_SECRET,
    AZURE_AD_B2C_PRIMARY_USER_FLOW: process.env.AZURE_AD_B2C_PRIMARY_USER_FLOW,
    AZURE_AD_B2C_LOGOUT_URL: process.env.AZURE_AD_B2C_LOGOUT_URL,
    AZURE_AD_B2C_TOKEN_ENDPOINT: process.env.AZURE_AD_B2C_TOKEN_ENDPOINT,
    NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET,
    NEXTAUTH_URL: process.env.NEXTAUTH_URL,
    PAGE_URL: process.env.PAGE_URL,
  },
  poweredByHeader: false,
  trailingSlash: true,
  basePath: '',
  // The starter code load resources from `public` folder with `router.basePath` in React components.
  // So, the source code is "basePath-ready".
  // You can remove `basePath` if you don't need it.
  reactStrictMode: true,
});

staticwebapp.config.json

{
  "platform": {
    "apiRuntime": "node:16"
  }
}

package.json

{
  "name": "next-js-boilerplate",
  "version": "3.6.0",
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "build-stats": "cross-env ANALYZE=true npm run build",
    "export": "next export",
    "build-prod": "run-s clean build export",
    "clean": "rimraf .next out",
    "lint": "next lint",
    "format": "next lint --fix && prettier '**/*.{json,yaml}' --write --ignore-path .gitignore",
    "check-types": "tsc --noEmit --pretty && tsc --project cypress --noEmit --pretty",
    "test": "jest",
    "commit": "cz",
    "cypress": "cypress open",
    "cypress:headless": "cypress run",
    "e2e": "start-server-and-test dev http://localhost:3000 cypress",
    "e2e:headless": "start-server-and-test dev http://localhost:3000 cypress:headless",
    "prepare": "husky install",
    "postbuild": "next-sitemap"
  },
  "dependencies": {
    "@headlessui/react": "^1.7.8",
    "@heroicons/react": "^2.0.14",
    "@microsoft/applicationinsights-react-js": "^3.4.0",
    "@microsoft/applicationinsights-web": "^2.8.9",
    "@tailwindcss/aspect-ratio": "^0.4.2",
    "@tailwindcss/forms": "^0.5.3",
    "axios": "^1.2.6",
    "axios-retry": "^3.4.0",
    "cookies-next": "^2.1.1",
    "history": "^5.3.0",
    "next": "^13.1.2",
    "next-auth": "^4.19.0",
    "next-seo": "^5.15.0",
    "next-sitemap": "^3.1.45",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-hook-form": "^7.42.1",
    "swr": "^2.0.3"
  },
  "devDependencies": {
    "@commitlint/cli": "^17.4.2",
    "@commitlint/config-conventional": "^17.4.2",
    "@commitlint/cz-commitlint": "^17.4.2",
    "@next/bundle-analyzer": "^13.1.2",
    "@percy/cli": "^1.17.0",
    "@percy/cypress": "^3.1.2",
    "@semantic-release/changelog": "^6.0.2",
    "@semantic-release/git": "^10.0.1",
    "@testing-library/cypress": "^9.0.0",
    "@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^13.4.0",
    "@types/jest": "^29.2.6",
    "@types/node": "^18.11.18",
    "@types/react": "^18.0.27",
    "@typescript-eslint/eslint-plugin": "^5.48.2",
    "@typescript-eslint/parser": "^5.48.2",
    "autoprefixer": "^10.4.13",
    "commitizen": "^4.3.0",
    "cross-env": "^7.0.3",
    "cssnano": "^5.1.14",
    "cypress": "^12.3.0",
    "eslint": "^8.32.0",
    "eslint-config-airbnb-base": "^15.0.0",
    "eslint-config-airbnb-typescript": "^17.0.0",
    "eslint-config-next": "^13.1.2",
    "eslint-config-prettier": "^8.6.0",
    "eslint-plugin-cypress": "^2.12.1",
    "eslint-plugin-import": "^2.27.5",
    "eslint-plugin-jest": "^27.2.1",
    "eslint-plugin-jest-dom": "^4.0.3",
    "eslint-plugin-jest-formatting": "^3.1.0",
    "eslint-plugin-jsx-a11y": "^6.7.1",
    "eslint-plugin-prettier": "^4.2.1",
    "eslint-plugin-react": "^7.32.1",
    "eslint-plugin-react-hooks": "^4.6.0",
    "eslint-plugin-simple-import-sort": "^9.0.0",
    "eslint-plugin-tailwindcss": "^3.8.0",
    "eslint-plugin-testing-library": "^5.9.1",
    "eslint-plugin-unused-imports": "^2.0.0",
    "husky": "^8.0.3",
    "jest": "^29.3.1",
    "jest-environment-jsdom": "^29.3.1",
    "lint-staged": "^13.1.0",
    "npm-run-all": "^4.1.5",
    "postcss": "^8.4.21",
    "prettier": "^2.8.3",
    "rimraf": "^4.1.1",
    "semantic-release": "^19.0.5",
    "start-server-and-test": "^1.15.2",
    "tailwindcss": "^3.2.4",
    "typescript": "^4.9.4"
  },
  "config": {
    "commitizen": {
      "path": "@commitlint/cz-commitlint"
    }
  },
  "release": {
    "branches": [
      "main"
    ],
    "plugins": [
      "@semantic-release/commit-analyzer",
      "@semantic-release/release-notes-generator",
      "@semantic-release/changelog",
      [
        "@semantic-release/npm",
        {
          "npmPublish": false
        }
      ],
      "@semantic-release/git",
      "@semantic-release/github"
    ]
  },
  "author": "Ixartz (https://github.com/ixartz)"
}

@vivekjilla
Copy link

Hi @xInfinitYz, Thanks for sharing all the details.

  • Currently the app is getting deployed against node:18 version, and if you want to use node:16 please specify that in your package.json using the engines property.
  • Also today when SWA deploys your Next.js app, it only uploads the node_modules of packages from 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.

@xInfinitYz
Copy link
Author

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!

@georgibakken
Copy link

georgibakken commented Jul 17, 2023

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.
image

They all seem to have the same errors
image

Those errors might be related to why I get this:
image

and not why I can't load the page.

You can see my complete struggle here

@georgibakken
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants