Skip to content
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

Suggestion: move chrome-aws-lambda to peer dependency #31

Closed
transitive-bullshit opened this issue Apr 7, 2022 · 6 comments
Closed
Assignees
Labels
enhancement New feature or request internal Related to internals of the library

Comments

@transitive-bullshit
Copy link
Contributor

transitive-bullshit commented Apr 7, 2022

Since the most recent version of chrome-aws-lambda is 49.7 MB, it leaves almost no room for additional client libs in the vercel lambda.

I've been running into this issue and it's really frustrating.

So my proposal is to switch chrome-aws-lambda to be a peer dependency and allow the user of this library to choose which chrome version they want to use.

See my other comment here for the savings we're talking about: #23 (comment)

This would require also making puppeteer-core a peer dependency, since the two versions need to match up.

@transitive-bullshit
Copy link
Contributor Author

In my case, after a lot of trial & error, I got everything working with v6.0.0 using resolution overrides as a temporary workaround: https://github.com/transitive-bullshit/nextjs-notion-starter-kit/blob/main/package.json#L72-L75

@neg4n neg4n added enhancement New feature or request internal Related to internals of the library labels Apr 8, 2022
@neg4n neg4n self-assigned this Apr 8, 2022
@neg4n
Copy link
Owner

neg4n commented Apr 8, 2022

Thanks @transitive-bullshit for your research regarding this topic 🤟🏻 Your suggestion about switching these dependencies to peerDependencies seems very sensible to me. I'll investigate the topic as well and apply the changes during this weekend 🚀

@neg4n
Copy link
Owner

neg4n commented Apr 11, 2022

https://github.com/neg4n/next-api-og-image/releases/tag/4.0.1

@neg4n neg4n closed this as completed Apr 11, 2022
@transitive-bullshit
Copy link
Contributor Author

@neg4n from what I can tell, puppeteer-core and chrome-aws-lambda need to have the same version (or close to the same version); otherwise, the dynamic library lookup fails.

What do you think about making puppeteer-core a peer dep as well?

@neg4n
Copy link
Owner

neg4n commented Apr 12, 2022

@neg4n from what I can tell, puppeteer-core and chrome-aws-lambda need to have the same version (or close to the same version); otherwise, the dynamic library lookup fails.

What do you think about making puppeteer-core a peer dep as well?

I think thats good idea but it needs further investigation. I've tried to do it when adding changes proposed in this issue but there were some circular deps (?) issues 👀

@LuighiV
Copy link

LuighiV commented May 30, 2022

Hi, I am trying to use the suggested versions for the packages of chrome-aws-lambda but I am getting this error when deploying in vercel:

ModuleNotFoundError: Module not found: Error: Can't resolve 'bufferutil' in '/vercel/path0/node_modules/next-api-og-image/node_modules/ws/lib'

Do you know how it can be resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request internal Related to internals of the library
Projects
None yet
Development

No branches or pull requests

3 participants