-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
[REQUEST] Please, make it work with Nextjs 13 #147
Comments
@ambrosil Must be listed as a webpack external |
ok, you mean like this ?
this doesn't seem to work ... |
@ambrosil No idea, I don't use Web pack, but there is a link to a thread on the main page with more information., sorry I'm on Mobile, otherwise I'd find the info |
ok i'll try, thanks for the support 👍 |
Do you have any updates or links for read? |
Okay, the idea is to use a webpack, but |
That code looks wrong. The externals documentation says to do something like
|
Probably in Node this works but in Next it's a bit more complicated. I'll take a look at the docs, if I find something I'll bring it here |
I think to define externals in Next.js you expose the webpack config in next.config.js for example
However this doesn't seem to fix the error for me, I'm still getting:
When deployed on Vercel. Has anyone else made progress with this? |
You may have to use the |
Appreciate the reply. I did try chromium-min but unfortunately my requests take too long and timeout. I think Vercel has a max execution time of 60 seconds. |
I do understand wanting to run your code together, but it's my advice that you decouple any chromium interactions from your users and maybe just run this separate. SQS with vanilla Lambda. All these build systems do things differently. That said, if you do figure it out, I'd be happy to add some info in the readme, or add examples. |
Off-topic but found a way to work with chromium-min. The 60 second timeout was being caused by an unnecessary |
I've heard that disabling the graphics stack will fix this bug |
As @masterbater said, the config should be: const nextConfig = {
experimental: {
serverComponentsExternalPackages: [
'puppeteer-core',
'@sparticuz/chromium'
]
}
} |
Does this work when trying to run puppeteer using Vercel cloud functions? |
Yes, but I had to use chromium-min instead since it reached the 50MB limit. See this article on how to do it. Puppeteer also took quite long to load my heavy page, which reached the max 10 second execution time of Vercel cloud, so I'm now using Vercel Pro with increased |
Thanks @foufrix above solution worked for me. |
What would you like to have implemented?
It would be awesome if you could add support for Next.js 13.
What happens right now is that the chromium.br file just disappear during the build with webpack 5 (i think cuz *br files are not handled by the webpack config, but i'm not completely sure), so i get this error when launching puppeteer server side in a Next.js app:
Can you help me, please ?
The text was updated successfully, but these errors were encountered: