-
-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Node 20 lambda support [testing wanted] #187
Conversation
It looks like in order to support node 20, along with 16 and 18, the node 20 dependencies will be need be bundled separately. |
The reason I haven't merged this yet is because I haven't had time to independently test this outside of the automated testing. |
If you publish a pre-release to npm, I'd be happy to give it a spin! I'm not sure I can verify everything you're looking for, but I can verify that we can still use it to render web pages enough to generate PDFs from them :) |
@benasher44 thank you, i will try to do that today. |
looking forward for that release, much appreciated 👍 |
I published 119.0.1-next.0 https://www.npmjs.com/package/@sparticuz/chromium/v/119.0.1-next.0 for testing |
I've also tagged it, so you can do @Sparticuz/chromium@next |
It's not working for us. Here are some logs (have dumpio: true):
I'm not sure if that's helpful (in the past, hasn't been that helpful). If there are tweaks I could make to get you more logs, let me know! |
great, I can confirm that it is working for us with |
Are you using custom args? |
using puppeteer 21.5.1, here is how we're launching import chromium from "@sparticuz/chromium";
import puppeteer from "puppeteer-core";
await puppeteer.launch({
args: chromium.args.concat(["--single-process"]),
defaultViewport: null,
executablePath: await chromium.executablePath(),
headless: true,
dumpio: true,
}) |
@Sparticuz after some local testing, I found it was failing to launch due to being unable to load nss:
After adding In the meantime, would it make sense to do publish another build with nss built-in? |
@ibqn were you testing https requests by chance? or only http? |
|
I just tried again with |
No, I think you'll need |
Ahh! Okay it's loading nss now, but I am also now reproducing the nssutil error:
Would you mind publishing a build with nss but without nss-util? Seeing as I was able to get it to work without explicitly install nss-util, I wonder if nss comes with "enough" for this to work but nss-util has a mismatched version of something (being vague because I really don't know all that much about nss + nss-util, but have worked with packages enough to smell this problem 👃 ). |
Github is filtering brotli files, so before using this, just delete the .gz file extension so the file is |
Okay so my hunch was wrong. Removing nss-util results in it failing to load nss because it can't load nss-util. However, if I |
OK, that's good info. The files in |
I compared the sha1sums of the libs in the curl'd version of the aws.tar.br in my most recent comment and the one that comes with -next.1. These libraries differed:
In other words, -next.1 is using different versions of these libraries somehow |
@benasher44 Ok, so the one you used was actually the one with the updated libs. We will need to verify that these ones still work in al2 |
I tested on AL 2 and got this output:
It looks like we'll have to further split the libraries for AL2 and AL2023 |
Hmm, I was afraid that might happen. Been busy with work the past few days, hopefully will build a new package today or tomorrow. |
I've got it working for me in testing on my local machine, which I haven't been able to get until now. I've got some cleanup to do, then will push another test today |
I just published @Sparticuz/chromium@119.0.1-next.2 I'm fairly confident it's working as expected! |
Confirmed working on AL2023! |
Thanks for your work and testing here all. @benasher44 I saw in your example above you're simply importing import puppeteer from "puppeteer-core"; Does this need to be imported as a separate layer? I'm able to add the Cannot find package 'puppeteer-core' imported from /var/task/index.mjs |
Oh I have a custom build that installs deps from a package.json, which included puppeteer-core |
Got it thanks @benasher44. For posterity's sake, I ended up having to build puppeteer-core |
@onassar did you ever make that public ARN for a layer? |
@AnYoung627 here's what I made available: https://onassar.github.io/blogs/web/2024/01/17/public-aws-lambda-function-layers/ Hopefully you find it useful. |
closes #185
closes #196
maybe #201?
also closes dependabot pr's:
closes #204
closes #203
closes #199
closes #198
closes #197
needed to add
during this PR, AL2 also updated libs in a breaking way, so this will also include updated AL2 libs