Open billyromano opened 2 years ago
Does the guidance in #99 help? Namely, adding the environment variable REQUIRED_OS_PACKAGES
in the pipeline YAML to install nasm
.
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
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! π€―
Oryx Version: 0.2.20220131.3, Commit: ec344c058843461525ff03b46031553b6e15a47a, ReleaseTagName: 20220131.3
Oryx Version: 0.2.20220401.1, Commit: afed4f696a08bfd4c8e4109704a082bf9fb20515, ReleaseTagName: 20220401.1
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...
/parent-folder
\
---> /azure-static-web-apps-deploy
/my-nextjs-project
FROM mcr.microsoft.com/appsvc/staticappsclient:stable
/
of the containerCOPY 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)
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" }
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
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.
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
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
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 themozjpeg
command (see below for error output from Bitbucket Pipelines using the Azure Static Web App Bitbucket Pipeline).Error Output
Steps To Reproduce
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