Azure / static-web-apps

Azure Static Web Apps. For bugs and feature requests, please create an issue in this repo. For community discussions, latest updates, kindly refer to the Discussions Tab. To know what's new in Static Web Apps, visit https://aka.ms/swa/ThisMonth
https://aka.ms/swa
MIT License
330 stars 56 forks source link

Azure devops deployment succeeds, website returns 502 #1059

Closed xInfinitYz closed 1 year ago

xInfinitYz commented 1 year ago

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 Verbose logging enabled
2023-01-30T08:15:46.3866668Z Build timeout not specified, defaulting to 15 minutes
2023-01-30T08:15:46.3867610Z App Directory Location: '/' was found.
2023-01-30T08:15:46.3868041Z config_file_location: config file '/staticwebapp.config.json' was found.
2023-01-30T08:15:46.3874883Z Looking for event info
2023-01-30T08:15:46.3898265Z Event info parsed from action options.
2023-01-30T08:15:46.9405301Z Starting to build app with Oryx
2023-01-30T08:15:46.9406311Z Azure 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
2023-01-30T08:15:46.9407817Z Calling 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
2023-01-30T08:15:46.9408730Z ---Oryx build logs---
2023-01-30T08:15:46.9409016Z 
2023-01-30T08:15:46.9409242Z 
2023-01-30T08:15:47.4750098Z Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
2023-01-30T08:15:47.4759913Z You can report issues at https://github.com/Microsoft/Oryx/issues
2023-01-30T08:15:47.4760434Z 
2023-01-30T08:15:47.4760954Z Oryx Version: 0.2.20221103.1, Commit: a2c65dde152b749fea395f4d1242ea9350942258, ReleaseTagName: 20221103.1
2023-01-30T08:15:47.4761350Z 
2023-01-30T08:15:47.4761696Z Build Operation ID: |HQmUreyBXoQ=.42f53b8d_
2023-01-30T08:15:47.4762134Z Repository Commit : 41554b998e7027a9b244a3def3b541e4fda91a3d
2023-01-30T08:15:47.4762449Z 
2023-01-30T08:15:47.5028438Z Detecting platforms...
2023-01-30T08:15:49.4926884Z Detected following platforms:
2023-01-30T08:15:49.4933085Z   nodejs: 18.12.1
2023-01-30T08:15:49.4999879Z Version '18.12.1' of platform 'nodejs' is not installed. Generating script to install it...
2023-01-30T08:15:49.5785766Z Detected the following frameworks: Typescript,Next.js
2023-01-30T08:15:49.7308541Z 
2023-01-30T08:15:49.7406438Z 
2023-01-30T08:15:49.7406829Z Source directory     : /working_dir
2023-01-30T08:15:49.7407333Z Destination directory: /607ce468-fe3e-4bbf-b01d-6cf1e3b6bc65-swa-oryx/app
2023-01-30T08:15:49.7407698Z 
2023-01-30T08:15:49.7424872Z 
2023-01-30T08:15:49.7425379Z Downloading and extracting 'nodejs' version '18.12.1' to '/opt/nodejs/18.12.1'...
2023-01-30T08:15:49.7463568Z Detected image debian flavor: bullseye.
2023-01-30T08:15:50.8027151Z Downloaded in 1 sec(s).
2023-01-30T08:15:50.8027622Z Verifying checksum...
2023-01-30T08:15:50.8118853Z Extracting contents...
2023-01-30T08:15:52.1246253Z performing sha512 checksum for: nodejs...
2023-01-30T08:15:52.3165248Z Done in 3 sec(s).
2023-01-30T08:15:52.3165885Z 
2023-01-30T08:15:52.3872481Z Removing existing manifest file
2023-01-30T08:15:52.3932734Z Creating directory for command manifest file if it does not exist
2023-01-30T08:15:52.3990101Z Creating a manifest file...
2023-01-30T08:15:52.3994436Z Node Build Command Manifest file created.
2023-01-30T08:15:52.3997056Z 
2023-01-30T08:15:52.4000633Z Using Node version:
2023-01-30T08:15:52.4065171Z v18.12.1
2023-01-30T08:15:52.4085288Z 
2023-01-30T08:15:52.4088474Z Using Npm version:
2023-01-30T08:15:52.8059845Z 8.19.2
2023-01-30T08:15:52.8160435Z 
2023-01-30T08:15:52.8164011Z Running 'npm install --unsafe-perm'...
2023-01-30T08:15:52.8166696Z 
2023-01-30T08:16:46.3705870Z npm 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
2023-01-30T08:17:05.1286877Z 
2023-01-30T08:17:05.1314378Z > next-js-boilerplate@3.6.0 prepare
2023-01-30T08:17:05.1322835Z > husky install
2023-01-30T08:17:05.1329329Z 
2023-01-30T08:17:05.2277515Z husky - Git hooks installed
2023-01-30T08:17:05.2662755Z 
2023-01-30T08:17:05.2678709Z added 1276 packages, and audited 1487 packages in 1m
2023-01-30T08:17:05.2700165Z 
2023-01-30T08:17:05.2707300Z 221 packages are looking for funding
2023-01-30T08:17:05.2707697Z   run `npm fund` for details
2023-01-30T08:17:05.2759814Z 
2023-01-30T08:17:05.2760224Z found 0 vulnerabilities
2023-01-30T08:17:05.3371160Z 
2023-01-30T08:17:05.3381038Z Running 'npm run build'...
2023-01-30T08:17:05.3437710Z 
2023-01-30T08:17:05.7476118Z 
2023-01-30T08:17:05.7480909Z > next-js-boilerplate@3.6.0 build
2023-01-30T08:17:05.7485127Z > next build
2023-01-30T08:17:05.7489142Z 
2023-01-30T08:17:06.1312974Z info  - Loaded env from /working_dir/.env.production.local
2023-01-30T08:17:06.1334909Z info  - Loaded env from /working_dir/.env
2023-01-30T08:17:06.3049405Z warn  - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
2023-01-30T08:17:06.3318255Z Attention: Next.js now collects completely anonymous telemetry regarding usage.
2023-01-30T08:17:06.3322409Z This information is used to shape Next.js' roadmap and prioritize features.
2023-01-30T08:17:06.3326508Z You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
2023-01-30T08:17:06.3329989Z https://nextjs.org/telemetry
2023-01-30T08:17:06.3334183Z 
2023-01-30T08:17:06.5011473Z info  - Linting and checking validity of types...
2023-01-30T08:17:26.4352233Z 
2023-01-30T08:17:26.4354555Z ./src/components/agency/ProfileComponent.tsx
2023-01-30T08:17:26.4362544Z 100:19  Warning: Classname 'bg-opacity-75' should be replaced by an opacity suffix (eg. '/75')  tailwindcss/migration-from-tailwind-2
2023-01-30T08:17:26.4363295Z 
2023-01-30T08:17:26.4363661Z ./src/core/components/filePreview.tsx
2023-01-30T08:17:26.4364204Z 107:15  Warning: Classname 'wrapper' is not a Tailwind CSS class!  tailwindcss/no-custom-classname
2023-01-30T08:17:26.4364774Z 
2023-01-30T08:17:26.4365519Z info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
2023-01-30T08:17:26.4366063Z info  - Creating an optimized production build...
2023-01-30T08:17:42.6380185Z info  - Compiled successfully
2023-01-30T08:17:42.6417042Z info  - Collecting page data...
2023-01-30T08:17:49.7219324Z info  - Generating static pages (0/9)
2023-01-30T08:17:49.8572785Z info  - Generating static pages (2/9)
2023-01-30T08:17:49.8724316Z info  - Generating static pages (4/9)
2023-01-30T08:17:49.9082844Z info  - Generating static pages (6/9)
2023-01-30T08:17:49.9262523Z info  - Generating static pages (9/9)
2023-01-30T08:17:49.9400074Z info  - Finalizing page optimization...
2023-01-30T08:17:49.9461635Z 
2023-01-30T08:17:50.0001860Z Route (pages)                              Size     First Load JS
2023-01-30T08:17:50.0003740Z ┌ ○ /                                      431 B           107 kB
2023-01-30T08:17:50.0004917Z ├   /_app                                  0 B            83.6 kB
2023-01-30T08:17:50.0005538Z ├ ○ /404                                   181 B          83.7 kB
2023-01-30T08:17:50.0006890Z ├ ○ /about                                 464 B           107 kB
2023-01-30T08:17:50.0007464Z ├ ○ /agency                                4.78 kB         189 kB
2023-01-30T08:17:50.0007909Z ├ λ /api/auth/[...nextauth]                0 B            83.6 kB
2023-01-30T08:17:50.0021590Z ├ ○ /login                                 1.2 kB         84.8 kB
2023-01-30T08:17:50.0022855Z ├ ○ /properties                            2.08 kB         130 kB
2023-01-30T08:17:50.0026040Z ├ ○ /property                              197 B           186 kB
2023-01-30T08:17:50.0026533Z └ ○ /property/[propertyid]                 617 B           190 kB
2023-01-30T08:17:50.0027580Z + First Load JS shared by all              90.1 kB
2023-01-30T08:17:50.0028537Z   ├ chunks/framework-114634acb84f8baa.js   45.4 kB
2023-01-30T08:17:50.0029117Z   ├ chunks/main-3c0f2a1ae62c4acb.js        27.1 kB
2023-01-30T08:17:50.0029613Z   ├ chunks/pages/_app-14a516abfea131a2.js  10.2 kB
2023-01-30T08:17:50.0030193Z   ├ chunks/webpack-ee7e63bc15b31913.js     815 B
2023-01-30T08:17:50.0030803Z   └ css/da6169150e392192.css               6.56 kB
2023-01-30T08:17:50.0031101Z 
2023-01-30T08:17:50.0031441Z ƒ Middleware                               61.9 kB
2023-01-30T08:17:50.0031747Z 
2023-01-30T08:17:50.0039224Z λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
2023-01-30T08:17:50.0040219Z ○  (Static)  automatically rendered as static HTML (uses no initial props)
2023-01-30T08:17:50.0040607Z 
2023-01-30T08:17:50.3109146Z 
2023-01-30T08:17:50.3116487Z > next-js-boilerplate@3.6.0 postbuild
2023-01-30T08:17:50.3123903Z > next-sitemap
2023-01-30T08:17:50.3130508Z 
2023-01-30T08:17:50.4257825Z Loaded env from /working_dir/.env.production.local
2023-01-30T08:17:50.4264789Z Loaded env from /working_dir/.env
2023-01-30T08:17:50.4295124Z ✨ [next-sitemap] Loading next-sitemap config: file:///working_dir/next-sitemap.config.js
2023-01-30T08:17:50.4371406Z ✅ [next-sitemap] Generation completed
2023-01-30T08:17:50.4391787Z ┌───────────────┬────────┐
2023-01-30T08:17:50.4397914Z │    (index)    │ Values │
2023-01-30T08:17:50.4398381Z ├───────────────┼────────┤
2023-01-30T08:17:50.4398674Z │ indexSitemaps │   1    │
2023-01-30T08:17:50.4403224Z │   sitemaps    │   1    │
2023-01-30T08:17:50.4407410Z └───────────────┴────────┘
2023-01-30T08:17:50.4412131Z -----------------------------------------------------
2023-01-30T08:17:50.4412533Z  SITEMAP INDICES 
2023-01-30T08:17:50.4412900Z -----------------------------------------------------
2023-01-30T08:17:50.4418215Z 
2023-01-30T08:17:50.4422488Z    ○ https://example.com/sitemap.xml
2023-01-30T08:17:50.4428264Z 
2023-01-30T08:17:50.4432552Z 
2023-01-30T08:17:50.4432934Z -----------------------------------------------------
2023-01-30T08:17:50.4437222Z  SITEMAPS 
2023-01-30T08:17:50.4441883Z -----------------------------------------------------
2023-01-30T08:17:50.4442238Z 
2023-01-30T08:17:50.4442550Z    ○ https://example.com/sitemap-0.xml
2023-01-30T08:17:50.4442906Z 
2023-01-30T08:17:50.4443123Z 
2023-01-30T08:17:50.4622581Z Preparing output...
2023-01-30T08:17:50.4627978Z 
2023-01-30T08:17:50.4632720Z Copying files to destination directory '/607ce468-fe3e-4bbf-b01d-6cf1e3b6bc65-swa-oryx/app'...
2023-01-30T08:17:55.5705277Z Done in 5 sec(s).
2023-01-30T08:17:55.5721261Z 
2023-01-30T08:17:55.5721613Z Removing existing manifest file
2023-01-30T08:17:55.5749853Z Creating a manifest file...
2023-01-30T08:17:55.5758201Z Manifest file created.
2023-01-30T08:17:55.5764569Z Copying .ostype to manifest output directory.
2023-01-30T08:17:55.5771085Z 
2023-01-30T08:17:55.5771412Z Done in 126 sec(s).
2023-01-30T08:17:56.6290935Z 
2023-01-30T08:17:56.6295166Z 
2023-01-30T08:17:56.6298914Z ---End of Oryx build logs---
2023-01-30T08:17:56.6299703Z Oryx build has completed. Took 129.6881669 seconds. Exit Code: 0
2023-01-30T08:17:56.6301478Z Found Oryx manifest file, checking for build location
2023-01-30T08:17:56.6302391Z Found Oryx build location: .next
2023-01-30T08:17:56.6303272Z Oryx has determined that the app build artifacts are in the '.next' directory. If this is incorrect please specify the app artifact location.
2023-01-30T08:17:56.6304049Z Finished building app with Oryx
2023-01-30T08:17:56.6312287Z No Api directory specified. Azure Functions will not be created.
2023-01-30T08:17:56.8853882Z Warning: For Next.js apps, staticwebapp.config.json features are not fully supported yet!
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 Determined default file to be: index.html
2023-01-30T08:17:56.8951540Z Using 'staticwebapp.config.json' file for configuration information, 'routes.json' will be ignored.
2023-01-30T08:17:56.9014518Z Copying 'staticwebapp.config.json' to build output
2023-01-30T08:17:58.5315495Z Starting to build function app with Oryx
2023-01-30T08:17:58.5320674Z Oryx will build function app with the following custom override command: rm -rf $SOURCE_DIR/node_modules/@next/swc-* && rm -rf $SOURCE_DIR/.next/cache
2023-01-30T08:17:58.5322520Z Calling 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
2023-01-30T08:17:58.5323963Z ---Oryx build logs---
2023-01-30T08:17:58.5324428Z 
2023-01-30T08:17:58.5324830Z 
2023-01-30T08:17:59.0423711Z Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
2023-01-30T08:17:59.0425285Z You can report issues at https://github.com/Microsoft/Oryx/issues
2023-01-30T08:17:59.0427628Z 
2023-01-30T08:17:59.0430559Z Oryx Version: 0.2.20221103.1, Commit: a2c65dde152b749fea395f4d1242ea9350942258, ReleaseTagName: 20221103.1
2023-01-30T08:17:59.0432497Z 
2023-01-30T08:17:59.0435121Z Build Operation ID: |WMYnFoPik8w=.55faa198_
2023-01-30T08:17:59.0437039Z 
2023-01-30T08:17:59.0817031Z Detecting platforms...
2023-01-30T08:18:01.1990666Z Detected following platforms:
2023-01-30T08:18:01.1991566Z   nodejs: 18.12.1
2023-01-30T08:18:01.2657313Z Detected the following frameworks: Next.js
2023-01-30T08:18:01.4095869Z 
2023-01-30T08:18:01.4165679Z 
2023-01-30T08:18:01.4172633Z Source directory     : /607ce468-fe3e-4bbf-b01d-6cf1e3b6bc65-swa-oryx/app
2023-01-30T08:18:01.4178885Z Destination directory: /607ce468-fe3e-4bbf-b01d-6cf1e3b6bc65-swa-oryx/api
2023-01-30T08:18:01.4179440Z 
2023-01-30T08:18:01.4871229Z Removing existing manifest file
2023-01-30T08:18:01.4879632Z Creating directory for command manifest file if it does not exist
2023-01-30T08:18:01.4915236Z Creating a manifest file...
2023-01-30T08:18:01.4925902Z Node Build Command Manifest file created.
2023-01-30T08:18:01.4932831Z 
2023-01-30T08:18:01.4939089Z Using Node version:
2023-01-30T08:18:01.4968916Z v18.12.1
2023-01-30T08:18:01.4978660Z 
2023-01-30T08:18:01.4984742Z Using Npm version:
2023-01-30T08:18:01.8801553Z 8.19.2
2023-01-30T08:18:01.8984710Z 
2023-01-30T08:18:01.8992215Z Installing production dependencies in '/607ce468-fe3e-4bbf-b01d-6cf1e3b6bc65-swa-oryx/app/.oryx_prod_node_modules'...
2023-01-30T08:18:01.8999002Z 
2023-01-30T08:18:01.9005807Z Running 'npm install --unsafe-perm --production'...
2023-01-30T08:18:01.9011363Z 
2023-01-30T08:18:02.2775034Z npm WARN config production Use `--omit=dev` instead.
2023-01-30T08:18:13.9943651Z 
2023-01-30T08:18:13.9954198Z added 192 packages, and audited 193 packages in 12s
2023-01-30T08:18:13.9960357Z 
2023-01-30T08:18:13.9965793Z 33 packages are looking for funding
2023-01-30T08:18:13.9971672Z   run `npm fund` for details
2023-01-30T08:18:13.9981965Z 
2023-01-30T08:18:13.9986593Z found 0 vulnerabilities
2023-01-30T08:18:14.0459652Z 
2023-01-30T08:18:14.0467059Z Copying 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'...
2023-01-30T08:18:16.5348972Z Done in 2 sec(s).
2023-01-30T08:18:16.5385768Z 
2023-01-30T08:18:16.5391019Z Running 'npm install --unsafe-perm'...
2023-01-30T08:18:16.5395616Z 
2023-01-30T08:18:19.8935640Z 
2023-01-30T08:18:19.8944987Z changed 21 packages, and audited 193 packages in 3s
2023-01-30T08:18:19.8951851Z 
2023-01-30T08:18:19.8958398Z 33 packages are looking for funding
2023-01-30T08:18:19.8964568Z   run `npm fund` for details
2023-01-30T08:18:19.8972371Z 
2023-01-30T08:18:19.8979135Z found 0 vulnerabilities
2023-01-30T08:18:19.9044365Z 
2023-01-30T08:18:19.9493461Z 
2023-01-30T08:18:19.9520989Z Preparing output...
2023-01-30T08:18:19.9529230Z 
2023-01-30T08:18:19.9536538Z Copying files to destination directory '/607ce468-fe3e-4bbf-b01d-6cf1e3b6bc65-swa-oryx/api'...
2023-01-30T08:18:22.2552683Z Done in 2 sec(s).
2023-01-30T08:18:22.2554012Z 
2023-01-30T08:18:22.2554347Z Removing existing manifest file
2023-01-30T08:18:22.2554742Z Creating a manifest file...
2023-01-30T08:18:22.2555107Z Manifest file created.
2023-01-30T08:18:22.2555530Z Copying .ostype to manifest output directory.
2023-01-30T08:18:22.2555856Z 
2023-01-30T08:18:22.2556143Z Done in 20 sec(s).
2023-01-30T08:18:22.9297318Z 
2023-01-30T08:18:22.9300094Z 
2023-01-30T08:18:22.9300494Z ---End of Oryx build logs---
2023-01-30T08:18:22.9302151Z Oryx build has completed. Took 24.3964941 seconds. Exit Code: 0
2023-01-30T08:18:22.9302704Z Function Runtime Information. OS: linux, Functions Runtime: ~4, node version: 18
2023-01-30T08:18:22.9303181Z Finished building function app with Oryx
2023-01-30T08:18:24.0908366Z Zipping Api Artifacts
2023-01-30T08:18:24.0909960Z Api Zip will be created from directory: /607ce468-fe3e-4bbf-b01d-6cf1e3b6bc65-swa-oryx/api
2023-01-30T08:18:24.0910817Z Api Content Hash: cdd77f96ed3d6d2a2fa2658766716bdf
2023-01-30T08:18:32.8902362Z Done Zipping Api Artifacts
2023-01-30T08:18:33.1264369Z Zipping App Artifacts
2023-01-30T08:18:33.1265071Z App Zip will be created from directory: /tmp/jigf0gxz.wz3
2023-01-30T08:18:33.1270322Z Done Zipping App Artifacts
2023-01-30T08:18:33.1275285Z Uploading build artifacts.
2023-01-30T08:18:34.2452304Z Finished Upload. Polling on deployment.
2023-01-30T08:18:34.3758752Z Status: InProgress. Time: 0.1307205(s)
2023-01-30T08:18:49.4208539Z Status: InProgress. Time: 15.1753778(s)
2023-01-30T08:19:04.4520241Z Status: InProgress. Time: 30.2060651(s)
2023-01-30T08:19:19.6198157Z Status: Succeeded. Time: 45.3719784(s)
2023-01-30T08:19:19.6199028Z Deployment Complete :)
2023-01-30T08:19:19.6199509Z Visit your site at: https://white-water-022b4e403.2.azurestaticapps.net
2023-01-30T08:19:19.6450895Z Thanks for using Azure Static Web Apps!
2023-01-30T08:19:19.6452825Z Exiting
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 commented 1 year ago

Hi @xInfinitYz, Thanks for sharing all the details.

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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!