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
323 stars 55 forks source link

Bitbucket Pipelines / Next.js -> Custom Image Loader: Oryx has failed to build the solution. #810

Open billyromano opened 2 years ago

billyromano commented 2 years ago

Description

When building an SSG Next.js v12 application using the command next build && next export with React v17 and Bitbucket Pipelines for CI/CD with an Azure Static Web App, the application fails to build.

The issue pertains to Oryx running the yarn install command to install dependencies and using a custom image loader replacement instead of a paid service provided by one of the Next.js image loader options. This Next.js application is using the NPM package next-optimized-images to setup a custom image loader for pure static site (SSG) output. The setup requires you to configure and install what optimization packages you'd like to use for your image format optimizations. The problem package at the moment is imagemin-mozjpeg and Oryx is failing to run the mozjpeg command (see below for error output from Bitbucket Pipelines using the Azure Static Web App Bitbucket Pipeline).

Error Output

[4/4] Building fresh packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error /opt/atlassian/pipelines/agent/build/node_modules/mozjpeg: Command failed.
Exit code: 1
Command: node lib/install.js
Arguments: 
Directory: /opt/atlassian/pipelines/agent/build/node_modules/mozjpeg
Output:
Command failed: /opt/atlassian/pipelines/agent/build/node_modules/mozjpeg/vendor/cjpeg -version
/opt/atlassian/pipelines/agent/build/node_modules/mozjpeg/vendor/cjpeg: /lib/x86_64-linux-gnu/libz.so.1: version `ZLIB_1.2.9' not found (required by /opt/atlassian/pipelines/agent/build/node_modules/mozjpeg/vendor/cjpeg)

mozjpeg pre-build test failed
compiling from source
Error: Command failed: /bin/sh -c ./configure --enable-static --disable-shared --disable-dependency-tracking --with-jpeg8  --prefix="/opt/atlassian/pipelines/agent/build/node_modules/mozjpeg/vendor" --bindir="/opt/atlassian/pipelines/agent/build/node_modules/mozjpeg/vendor" --libdir="/opt/atlassian/pipelines/agent/build/node_modules/mozjpeg/vendor"
configure: error: no nasm (Netwide Assembler) found

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... none
checking how to run the C preprocessor... gcc -E
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) none
checking for ar... ar
checking the archiver (ar) interface... ar
checking dependency style of gcc... none
checking the archiver (ar) interface... (cached) ar
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux [ld.so](http://ld.so/)
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking whether ln -s works... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking size of size_t... 8
checking whether compiler supports pointers to undefined structures... yes
checking whether __SUNPRO_C is declared... no
checking for pow in -lm... yes
checking for libpng... yes
checking for ANSI C header files... (cached) yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdlib.h... (cached) yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for string.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking whether char is unsigned... no
checking for inline... inline
checking for size_t... yes
checking for unsigned char... yes
checking for unsigned short... yes
checking if right shift is signed... yes
checking for memset... yes
checking for memcpy... yes
checking libjpeg API version... 8.0
checking libjpeg shared library version... 8.1.2
checking whether the linker supports version scripts... yes (GNU style)
checking whether to use version script when building mozjpeg... yes
checking for inline... inline __attribute__((always_inline))
checking whether to include arithmetic encoding support... yes
checking whether to include arithmetic decoding support... yes
checking whether to use 12-bit samples... no
checking whether to build TurboJPEG C wrapper... yes
checking whether to build TurboJPEG Java wrapper... no
checking if we have SIMD optimisations for cpu type... yes (x86_64)
checking for nasm... no
checking for nasmw... no
checking for yasm... no

    at /opt/atlassian/pipelines/agent/build/node_modules/execa/index.js:231:11
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Promise.all (index 0)

---End of Oryx build logs---
Oryx has failed to build the solution.

For further information, please visit the Azure Static Web Apps documentation at https://docs.microsoft.com/en-us/azure/static-web-apps/
If you believe this behavior is unexpected, please raise a GitHub issue at https://github.com/azure/static-web-apps/issues/
Exiting

Steps To Reproduce

  1. Run the Next.js SSG pipeline in Bitbucket which runs the command next build && next export

Possible Fix

Based on the error output above, it states: no nasm (Netwide Assembler) found I'm assuming it needs the nasm package installed in the Oryx Docker Image in order to properly install and run the mozjpeg dependency. Linux Ubuntu install command: sudo apt install nasm

joslinmicrosoft commented 2 years ago

Does the guidance in #99 help? Namely, adding the environment variable REQUIRED_OS_PACKAGES in the pipeline YAML to install nasm.

billyromano commented 2 years ago

Yes, adding the REQUIRED_OS_PACKAGES environment variable works! I updated my bitbucket-pipelines.yml file with the following:

pipelines:

    branches:
        develop:
            -
                step:
                    name:       Deploy Node.js App to Azure
                    deployment: staging
                    script:
                        -
                            pipe: microsoft/azure-static-web-apps-deploy:main
                            variables:
                                REQUIRED_OS_PACKAGES: nasm
                                APP_LOCATION:         '$BITBUCKET_CLONE_DIR'
#                                API_LOCATION:         '$BITBUCKET_CLONE_DIR/src/pages/api'
                                OUTPUT_LOCATION:      '$BITBUCKET_CLONE_DIR/out'
                                APP_BUILD_COMMAND:    'yarn build:staging'
                                API_TOKEN:            $deployment_token
billyromano commented 2 years ago

However, now that I can get the project to build successfully the images aren't loading now😩 The images have an HTTP 200 response status, show alt text visually and load about 130b for all images (and font files). The CSS and JS files work fine and load correctly though☺️

I'm using the next-optimized-images setup which works as expected for SSG output with Next.js. However, it seems as though the Oryx setup is not properly setting image permissions? I've done a lot of testing on this and realized that using a newer Oryx version seems to fix the image issue. To test this image loading issue, I'm using both Bitbucket Pipelines Docker deployment and a local Azure Static Web App Docker container to deploy and test local deploy compared to bitbucket deploy. I've concluded that the Oryx version of my local deploy is a little newer than what Bitbucket Pipelines is using which shows the images correctly on the static web app, but both Docker containers should be using the same version! 🀯

Bitbucket Pipelines Docker Test Log Output:

Oryx Version: 0.2.20220131.3, Commit: ec344c058843461525ff03b46031553b6e15a47a, ReleaseTagName: 20220131.3

Local Azure Static Web App Test Log Output:

Oryx Version: 0.2.20220401.1, Commit: afed4f696a08bfd4c8e4109704a082bf9fb20515, ReleaseTagName: 20220401.1

πŸ™‹πŸ»β€β™‚οΈHow do I tell Bitbucket Pipelines to use a newer version of Oryx?

That doesn't make sense to me since I'm using the same Azure Static Web App Docker container locally that Bitbucket Pipelines is using...

😎Here's how I replicate the Azure Static Web Apps Deploy from Bitbucket locally using Docker:

  1. Clone the Microsoft Bitbucket Azure Pipes / Azure Static Web Apps Deploy project to the same parent folder of your Next.js git project.
    /parent-folder
    \
      ---> /azure-static-web-apps-deploy
           /my-nextjs-project
  2. Update the Dockerfile to include a reference to your Next.js git project. e.g.:
    
    FROM mcr.microsoft.com/appsvc/staticappsclient:stable

Copies your code file from your action repository to the filesystem path / of the container

COPY azure-static-web-apps-deploy/pipe / RUN chmod a+x /*.sh

COPY my-nextjs-project / # <--- add this line to point to your project RUN rm -rf /my-nextjs-project/node_modules # <--- add this line to point to your project (Oryx will install the modules instead)

Code file to execute when the docker container starts up (entrypoint.sh)

ENTRYPOINT ["sh", "/pipe.sh"]

3. Run this Docker build command from the 'parent' folder that contains both this docker repository and your Next.js project: `docker build -t my-account/azure-static-web-apps-deploy -f azure-static-web-apps-deploy/Dockerfile .`
4. Run this Docker Container run command to start the deployment process: 

docker run -it \ -e API_TOKEN="my_unique_api_token_from_azure_static_web_apps" \ -e APP_LOCATION="my-nextjs-project" \ -e OUTPUT_LOCATION="/my-nextjs-project/out" \ -e REQUIRED_OS_PACKAGES="nasm" \ -e APP_BUILD_COMMAND="yarn build" \ my-account/azure-static-web-apps-deploy

5. Look at the output log and notice it's exactly the same from Bitbucket Pipelines. However, the only thing different locally is the Oryx version is slightly newer than what Bitbucket Pipelines says, but both environments (Bitbucket and Local) are using the same Docker Images! I'm stumped🀯

#### NOTE: Make sure your Next.js package.json is updated for [SSG (static site generator) output](https://nextjs.org/docs/advanced-features/static-html-export#next-export).

"scripts": { "build": "next build && next export" }

rupareddy5-21 commented 2 years ago

Hi @billyromano Thanks for bringing this to our attention, the issue is fixed now, you can test it now and please let us know if the issue still persists. Thanks

billyromano commented 2 years ago

I just did a Bitbucket pipeline build and the images are still not showing, but I did notice the Oryx version is updated now and it's showing Oryx Version: 0.2.20220401.1 in the Bitbucket log, so that's a start in the right directionπŸ™‚

I'm confused now why the images are not showing if the Oryx versions are the same between my local docker and Bitbucket pipeline docker. The images will show up only if I use docker locally to deploy, so this is strange. I'll include my docker log output from both local and Bitbucket pipelines.

billyromano commented 2 years ago

Bitbucket Pipeline Build Log:

Status: Downloaded newer image for [staticwebapps.azurecr.io/bitbucket-deploy:latest](http://staticwebapps.azurecr.io/bitbucket-deploy:latest)
DeploymentId: 1afdaa24-8964-4eb2-9bf8-dbaf20d0082e
App Directory Location: '/opt/atlassian/pipelines/agent/build' was found.
No Api directory specified. Azure Functions will not be created.
Looking for event info
Could not get event info. Proceeding
Starting to build app with Oryx
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
Oryx will build app with the following custom override command: yarn build:staging
---Oryx build logs---
Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues
Oryx Version: 0.2.20220401.1, Commit: afed4f696a08bfd4c8e4109704a082bf9fb20515, ReleaseTagName: 20220401.1
Build Operation ID: |dDr0cQA/kzQ=.43456395_
Repository Commit : f2007c6613671eacb738ffd1f7478eb10959581a
Detecting platforms...
Detected following platforms:
  nodejs: 17.6.0
Version '17.6.0' of platform 'nodejs' is not installed. Generating script to install it...
Detected the following frameworks: jQuery,Next.js
Source directory     : /opt/atlassian/pipelines/agent/build
Destination directory: /bin/staticsites/ss-oryx/app
Downloading and extracting 'nodejs' version '17.6.0' to '/opt/nodejs/17.6.0'...
Downloaded in 1 sec(s).
Verifying checksum...
Extracting contents...
performing sha512 checksum for: nodejs...
Done in 2 sec(s).
Ign:1 http://deb.debian.org/debian stretch InRelease
Get:2 http://security.debian.org/debian-security stretch/updates InRelease [53.0 kB]
Get:3 http://deb.debian.org/debian stretch-updates InRelease [93.6 kB]
Get:4 http://deb.debian.org/debian stretch Release [118 kB]
Get:5 http://deb.debian.org/debian stretch Release.gpg [3177 B]
Get:6 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [782 kB]
Get:7 http://deb.debian.org/debian stretch/main amd64 Packages [7080 kB]
Fetched 8129 kB in 1s (5062 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  nasm
0 upgraded, 1 newly installed, 0 to remove and 46 not upgraded.
Need to get 1608 kB of archives.
After this operation, 4854 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian stretch/main amd64 nasm amd64 2.12.01-1+b1 [1608 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 1608 kB in 0s (57.4 MB/s)
Selecting previously unselected package nasm.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 31877 files and directories currently installed.)
Preparing to unpack .../nasm_2.12.01-1+b1_amd64.deb ...
Unpacking nasm (2.12.01-1+b1) ...
Setting up nasm (2.12.01-1+b1) ...
Removing existing manifest file
Creating directory for command manifest file if it does not exist
Creating a manifest file...
Node Build Command Manifest file created.
Using Node version:
v17.6.0
Using Yarn version:
1.22.15
Running 'yarn install --prefer-offline'...
yarn install v1.22.15
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
warning url-loader@1.1.2: Invalid bin field for "url-loader".
info @next/swc-android-arm-eabi@12.1.6: The platform "linux" is incompatible with this module.
info "@next/swc-android-arm-eabi@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
info @next/swc-android-arm-eabi@12.1.6: The CPU architecture "x64" is incompatible with this module.
info @next/swc-android-arm64@12.1.6: The platform "linux" is incompatible with this module.
info "@next/swc-android-arm64@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
info @next/swc-android-arm64@12.1.6: The CPU architecture "x64" is incompatible with this module.
info @next/swc-darwin-arm64@12.1.6: The platform "linux" is incompatible with this module.
info "@next/swc-darwin-arm64@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
info @next/swc-darwin-arm64@12.1.6: The CPU architecture "x64" is incompatible with this module.
info @next/swc-darwin-x64@12.1.6: The platform "linux" is incompatible with this module.
info "@next/swc-darwin-x64@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
info @next/swc-linux-arm-gnueabihf@12.1.6: The CPU architecture "x64" is incompatible with this module.
info "@next/swc-linux-arm-gnueabihf@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
info @next/swc-linux-arm64-gnu@12.1.6: The CPU architecture "x64" is incompatible with this module.
info "@next/swc-linux-arm64-gnu@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
info @next/swc-linux-arm64-musl@12.1.6: The CPU architecture "x64" is incompatible with this module.
info "@next/swc-linux-arm64-musl@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
info @next/swc-win32-arm64-msvc@12.1.6: The platform "linux" is incompatible with this module.
info "@next/swc-win32-arm64-msvc@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
info @next/swc-win32-arm64-msvc@12.1.6: The CPU architecture "x64" is incompatible with this module.
info @next/swc-win32-ia32-msvc@12.1.6: The platform "linux" is incompatible with this module.
info "@next/swc-win32-ia32-msvc@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
info @next/swc-win32-ia32-msvc@12.1.6: The CPU architecture "x64" is incompatible with this module.
info @next/swc-win32-x64-msvc@12.1.6: The platform "linux" is incompatible with this module.
info "@next/swc-win32-x64-msvc@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@2.3.2: The platform "linux" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning "next-optimized-images > file-loader@3.0.1" has unmet peer dependency "webpack@^4.0.0".
warning "next-optimized-images > raw-loader@2.0.0" has unmet peer dependency "webpack@^4.3.0".
warning "next-optimized-images > url-loader@1.1.2" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0".
warning "react-select > @emotion/react > @emotion/babel-plugin@11.9.2" has unmet peer dependency "@babel/core@^7.0.0".
warning "react-select > @emotion/react > @emotion/babel-plugin > @babel/plugin-syntax-jsx@7.17.12" has unmet peer dependency "@babel/core@^7.0.0-0".
warning " > responsive-loader@3.0.4" has unmet peer dependency "webpack@^5.73.0".
warning " > video-react@0.15.0" has incorrect peer dependency "react@^15.0.0 || ^16.0.0 || ^17.0.0".
warning " > video-react@0.15.0" has incorrect peer dependency "react-dom@^15.0.0 || ^16.0.0 || ^17.0.0".
warning " > webp-loader@0.6.0" has unmet peer dependency "webpack@*".
warning " > webp-loader@0.6.0" has unmet peer dependency "webpack-cli@*".
warning "eslint-config-next > @typescript-eslint/parser > @typescript-eslint/typescript-estree > tsutils@3.21.0" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
warning " > next-sitemap@3.1.10" has unmet peer dependency "@next/env@*".
[5/5] Building fresh packages...
Done in 79.26s.
yarn run v1.22.15
$ next build && yarn sitemap:staging && next export
info  - Loaded env from /opt/atlassian/pipelines/agent/build/.env.production
info  - Loaded env from /opt/atlassian/pipelines/agent/build/.env
warn  - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
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:
https://nextjs.org/telemetry
info  - Checking validity of types...
info  - Creating an optimized production build...
info  - Collecting page data...
warn  - Compiled with warnings
./components/footer.js
Critical dependency: the request of a dependency is an expression
Import trace for requested module:
./pages/index.js
./components/footer.js
Critical dependency: the request of a dependency is an expression
Import trace for requested module:
./pages/index.js
info  - Generating static pages (0/3)
info  - Generating static pages (3/3)
info  - Finalizing page optimization...
Page                                       Size     First Load JS
β”Œ ● /                                      73 kB           180 kB
β”œ   β”” css/a004d7048633ebcc.css             785 B
β”œ   /_app                                  0 B             107 kB
β”” β—‹ /404                                   193 B           108 kB
+ First Load JS shared by all              107 kB
  β”œ chunks/framework-a87821de553db91d.js   45 kB
  β”œ chunks/main-75fab65fac2051e9.js        28.7 kB
  β”œ chunks/pages/_app-1969513a9505dc51.js  31.9 kB
  β”œ chunks/webpack-ff8edc7cca9f958f.js     1.73 kB
  β”” css/d5fe5dceccfd9de8.css               49.8 kB
β—‹  (Static)  automatically rendered as static HTML (uses no initial props)
●  (SSG)     automatically generated as static HTML + JSON (uses getStaticProps)
$ cross-env ENV=development next-sitemap
Loaded env from /opt/atlassian/pipelines/agent/build/.env.production
Loaded env from /opt/atlassian/pipelines/agent/build/.env
✨ [next-sitemap] Loading next-sitemap config: file:///opt/atlassian/pipelines/agent/build/next-sitemap.config.js
βœ… [next-sitemap] Generation completed
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    (index)    β”‚ Values β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ indexSitemaps β”‚   1    β”‚
β”‚   sitemaps    β”‚   0    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”˜
info  - Loaded env from /opt/atlassian/pipelines/agent/build/.env.production
info  - Loaded env from /opt/atlassian/pipelines/agent/build/.env
info  - using build directory: /opt/atlassian/pipelines/agent/build/.next
info  - Copying "static build" directory
info  - Launching 7 workers
info  - Exporting (0/3)
info  - Copying "public" directory
info  - Exporting (3/3)
Export successful. Files written to /opt/atlassian/pipelines/agent/build/out
Done in 25.45s.
Preparing output...
Copying files to destination directory '/bin/staticsites/ss-oryx/app'...
Done in 5 sec(s).
Removing existing manifest file
Creating a manifest file...
Manifest file created.
Done in 117 sec(s).
---End of Oryx build logs---
Finished building app with Oryx
Either no Api directory was specified, or the specified directory was not found. Azure Functions will not be created.
Zipping App Artifacts
Done Zipping App Artifacts
Uploading build artifacts.
Finished Upload. Polling on deployment.
Status: InProgress. Time: 0.0649903(s)
Status: Succeeded. Time: 15.1272901(s)
Deployment Complete :)
Visit your site at: https://XXXXXX/
Thanks for using Azure Static Web Apps!
Exiting
billyromano commented 2 years ago

Local Docker Deployment Log (Images work/show up on website):

DeploymentId: 20866c58-1076-4612-ad1a-abd9f092ca2f

App Directory Location: 'PROJECT_NAME' was found.
No Api directory specified. Azure Functions will not be created.
Looking for event info
Could not get event info. Proceeding
Starting to build app with Oryx
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
Oryx will build app with the following custom override command: yarn build:staging
---Oryx build logs---

Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues

Oryx Version: 0.2.20220401.1, Commit: afed4f696a08bfd4c8e4109704a082bf9fb20515, ReleaseTagName: 20220401.1

Build Operation ID: |e9etLhb/ppA=.c31237a6_
Repository Commit : f2007c6613671eacb738ffd1f7478eb10959581a

Detecting platforms...
Detected following platforms:
  nodejs: 17.6.0
Version '17.6.0' of platform 'nodejs' is not installed. Generating script to install it...
Detected the following frameworks: jQuery,Next.js

Source directory     : /PROJECT_NAME
Destination directory: /bin/staticsites/ss-oryx/app

Downloading and extracting 'nodejs' version '17.6.0' to '/opt/nodejs/17.6.0'...
Downloaded in 3 sec(s).
Verifying checksum...
Extracting contents...
performing sha512 checksum for: nodejs...
Done in 4 sec(s).

Ign:1 http://deb.debian.org/debian stretch InRelease
Get:2 http://security.debian.org/debian-security stretch/updates InRelease [53.0 kB]
Get:3 http://deb.debian.org/debian stretch-updates InRelease [93.6 kB]
Get:4 http://deb.debian.org/debian stretch Release [118 kB]
Get:5 http://deb.debian.org/debian stretch Release.gpg [3177 B]
Get:6 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [782 kB]
Get:7 http://deb.debian.org/debian stretch/main amd64 Packages [7080 kB]
Fetched 8129 kB in 1s (4717 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  nasm
0 upgraded, 1 newly installed, 0 to remove and 46 not upgraded.
Need to get 1608 kB of archives.
After this operation, 4854 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian stretch/main amd64 nasm amd64 2.12.01-1+b1 [1608 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 1608 kB in 0s (12.4 MB/s)
                                 Selecting previously unselected package nasm.
                                                                              (Reading database ...
                                                                                                    (Reading database ... 5%
              (Reading database ... 10%
                                       (Reading database ... 15%
                                                                (Reading database ... 20%
                                                                                         (Reading database ... 25%
    (Reading database ... 30%
                             (Reading database ... 35%
                                                      (Reading database ... 40%
                                                                               (Reading database ... 45%
                                                                                                        (Reading database ... 50%
                   (Reading database ... 55%
                                            (Reading database ... 60%
                                                                     (Reading database ... 65%
                                                                                              (Reading database ... 70%
         (Reading database ... 75%
                                  (Reading database ... 80%
                                                           (Reading database ... 85%
                                                                                    (Reading database ... 90%
                                                                                                             (Reading database ... 95%
                        (Reading database ... 100%
                                                  (Reading database ... 31877 files and directories currently installed.)
           Preparing to unpack .../nasm_2.12.01-1+b1_amd64.deb ...
                                                                  Unpacking nasm (2.12.01-1+b1) ...
                                                                                                   Setting up nasm (2.12.01-1+b1) ...
                       Removing existing manifest file
Creating directory for command manifest file if it does not exist
Creating a manifest file...
Node Build Command Manifest file created.

Using Node version:
v17.6.0
Using Yarn version:
1.22.15

Running 'yarn install --prefer-offline'...

yarn install v1.22.15
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
warning url-loader@1.1.2: Invalid bin field for "url-loader".
info @next/swc-android-arm-eabi@12.1.6: The platform "linux" is incompatible with this module.
info "@next/swc-android-arm-eabi@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
info @next/swc-android-arm-eabi@12.1.6: The CPU architecture "x64" is incompatible with this module.
info @next/swc-android-arm64@12.1.6: The platform "linux" is incompatible with this module.
info "@next/swc-android-arm64@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
info @next/swc-android-arm64@12.1.6: The CPU architecture "x64" is incompatible with this module.
info @next/swc-darwin-arm64@12.1.6: The platform "linux" is incompatible with this module.
info "@next/swc-darwin-arm64@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
info @next/swc-darwin-arm64@12.1.6: The CPU architecture "x64" is incompatible with this module.
info @next/swc-darwin-x64@12.1.6: The platform "linux" is incompatible with this module.
info "@next/swc-darwin-x64@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
info @next/swc-linux-arm-gnueabihf@12.1.6: The CPU architecture "x64" is incompatible with this module.
info "@next/swc-linux-arm-gnueabihf@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
info @next/swc-linux-arm64-gnu@12.1.6: The CPU architecture "x64" is incompatible with this module.
info "@next/swc-linux-arm64-gnu@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
info @next/swc-linux-arm64-musl@12.1.6: The CPU architecture "x64" is incompatible with this module.
info "@next/swc-linux-arm64-musl@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
info @next/swc-win32-arm64-msvc@12.1.6: The platform "linux" is incompatible with this module.
info "@next/swc-win32-arm64-msvc@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
info @next/swc-win32-arm64-msvc@12.1.6: The CPU architecture "x64" is incompatible with this module.
info @next/swc-win32-ia32-msvc@12.1.6: The platform "linux" is incompatible with this module.
info "@next/swc-win32-ia32-msvc@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
info @next/swc-win32-ia32-msvc@12.1.6: The CPU architecture "x64" is incompatible with this module.
info @next/swc-win32-x64-msvc@12.1.6: The platform "linux" is incompatible with this module.
info "@next/swc-win32-x64-msvc@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@2.3.2: The platform "linux" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning "next-optimized-images > file-loader@3.0.1" has unmet peer dependency "webpack@^4.0.0".
warning "next-optimized-images > raw-loader@2.0.0" has unmet peer dependency "webpack@^4.3.0".
warning "next-optimized-images > url-loader@1.1.2" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0".
warning "react-select > @emotion/react > @emotion/babel-plugin@11.9.2" has unmet peer dependency "@babel/core@^7.0.0".
warning "react-select > @emotion/react > @emotion/babel-plugin > @babel/plugin-syntax-jsx@7.17.12" has unmet peer dependency "@babel/core@^7.0.0-0".
warning " > responsive-loader@3.0.4" has unmet peer dependency "webpack@^5.73.0".
warning " > video-react@0.15.0" has incorrect peer dependency "react@^15.0.0 || ^16.0.0 || ^17.0.0".
warning " > video-react@0.15.0" has incorrect peer dependency "react-dom@^15.0.0 || ^16.0.0 || ^17.0.0".
warning " > webp-loader@0.6.0" has unmet peer dependency "webpack@*".
warning " > webp-loader@0.6.0" has unmet peer dependency "webpack-cli@*".
warning "eslint-config-next > @typescript-eslint/parser > @typescript-eslint/typescript-estree > tsutils@3.21.0" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
warning " > next-sitemap@3.1.10" has unmet peer dependency "@next/env@*".
[5/5] Building fresh packages...
Done in 84.71s.

yarn run v1.22.15
$ next build && yarn sitemap:staging && next export
info  - Loaded env from /PROJECT_NAME/.env.production
info  - Loaded env from /PROJECT_NAME/.env
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
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:
https://nextjs.org/telemetry

info  - Checking validity of types...
info  - Creating an optimized production build...
info  - Collecting page data...
warn  - Compiled with warnings

./components/footer.js
Critical dependency: the request of a dependency is an expression

Import trace for requested module:
./pages/index.js

./components/footer.js
Critical dependency: the request of a dependency is an expression

Import trace for requested module:
./pages/index.js

info  - Generating static pages (0/3)
info  - Generating static pages (3/3)
info  - Finalizing page optimization...

Page                                       Size     First Load JS
β”Œ ● / (305 ms)                             73 kB           180 kB
β”œ   β”” css/a004d7048633ebcc.css             785 B
β”œ   /_app                                  0 B             107 kB
β”” β—‹ /404                                   193 B           108 kB
+ First Load JS shared by all              107 kB
  β”œ chunks/framework-a87821de553db91d.js   45 kB
  β”œ chunks/main-75fab65fac2051e9.js        28.7 kB
  β”œ chunks/pages/_app-1969513a9505dc51.js  31.9 kB
  β”œ chunks/webpack-ed8f24ad332129e0.js     1.73 kB
  β”” css/d541e450b1088408.css               49.8 kB

β—‹  (Static)  automatically rendered as static HTML (uses no initial props)
●  (SSG)     automatically generated as static HTML + JSON (uses getStaticProps)

$ cross-env ENV=development next-sitemap
Loaded env from /PROJECT_NAME/.env.production
Loaded env from /PROJECT_NAME/.env
✨ [next-sitemap] Loading next-sitemap config: file:///PROJECT_NAME/next-sitemap.config.js
βœ… [next-sitemap] Generation completed
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    (index)    β”‚ Values β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ indexSitemaps β”‚   1    β”‚
β”‚   sitemaps    β”‚   0    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”˜

info  - Loaded env from /PROJECT_NAME/.env.production
info  - Loaded env from /PROJECT_NAME/.env
info  - using build directory: /PROJECT_NAME/.next
info  - Copying "static build" directory
info  - Launching 5 workers
info  - Exporting (0/3)
info  - Copying "public" directory
info  - Exporting (3/3)
Export successful. Files written to /PROJECT_NAME/out
Done in 27.89s.

Preparing output...

Copying files to destination directory '/bin/staticsites/ss-oryx/app'...
Done in 8 sec(s).

Removing existing manifest file
Creating a manifest file...
Manifest file created.

Done in 131 sec(s).

---End of Oryx build logs---
Finished building app with Oryx
Either no Api directory was specified, or the specified directory was not found. Azure Functions will not be created.
Zipping App Artifacts
Done Zipping App Artifacts
Uploading build artifacts.
Finished Upload. Polling on deployment.
Status: InProgress. Time: 0.1182213(s)
Status: InProgress. Time: 15.2263431(s)
Status: Succeeded. Time: 30.3336657(s)
Deployment Complete :)
Visit your site at: https://XXXXXX
Thanks for using Azure Static Web Apps!
Exiting