amplify-hosting icon indicating copy to clipboard operation
amplify-hosting copied to clipboard

NextJS >= 12.0.X OpenSSL / SWC build issue

Open Rafcin opened this issue 3 years ago • 2 comments

Before opening, please confirm:

App Id

NA

Region

us-west-2

Amplify Hosting feature

Build settings, Custom builds

Describe the bug

I'm just opening this issue for tracking, and I understand Next 12 isn't officially supported; however, this will still be nice to have. With Next 12 some users might be running into the following issue when using SWC:

Attempted to load @next/swc-linux-x64-gnu, but an error occurred: libssl.so.1.1: cannot open shared object file: No such file or directory
2022-07-21T18:26:27.270Z [INFO]: appname:build: warn  - Attempted to load @next/swc-linux-x64-gnux32, but it was not installed
                                 appname:build: warn  - Attempted to load @next/swc-linux-x64-musl, but an error occurred: libc.musl-x86_64.so.1: cannot open shared object file: No such file or directory

This seems to stem from Openssl not being installed properly with the default latest image from Amplify. I don't think this needs any staff action, but I'd like to create this issue to bring attention to this and perhaps have the docker image looked at making sure that it's installing all the resources needed for deployments until the new build system is done and or the image is updated to Amazon Linux 2022 (or 2020 whatever it's called).

I'm working on a fix for the OpenSSL issue right now, and I'll keep people in the thread updated.

Quick separate note. Don't use Node 18. Amazon Linux uses GLIBC_2.26 and Josef found an issue where if you use Node 18 it will throw node: /lib64/libc.so.6: version GLIBC_2.28' not found (required by node)`. Just a random thing to note.

Expected behavior

Libssl and Libcrypto should just be readable and SSL should appear in /usr/lib/

Reproduction steps

Deploy Next 12 with SWC.

Build Settings

NA

Additional information

NA

Rafcin avatar Jul 22 '22 02:07 Rafcin

Hi @Rafcin 👋🏽 thanks for opening this for tracking purposes. We are tracking this internally as well.

ghost avatar Jul 22 '22 20:07 ghost

I have tested swcMinify set to true today with Next.js 12.2.3, 12.2.4 and 12.2.5. All three built OK, so I believe this is resolved for Next.js >= 12.2.3.

michrome avatar Aug 26 '22 12:08 michrome

This issue is already solved. Thanks for reporting it!

calavera avatar Nov 17 '22 20:11 calavera

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

github-actions[bot] avatar Nov 17 '22 20:11 github-actions[bot]

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Nov 17 '22 21:11 github-actions[bot]