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

puppeteer issue with Apple Silicon chips #6885

Open
square-li opened this issue Apr 12, 2024 · 19 comments
Open

puppeteer issue with Apple Silicon chips #6885

square-li opened this issue Apr 12, 2024 · 19 comments

Comments

@square-li
Copy link

Issue Summary

With Apple Silicon chips (ARM), execute yarn to install dependencies will fail like

error /Users/.../redash/node_modules/puppeteer: Command failed.
Exit code: 1
Command: node install.js
Arguments:
Directory: /Users/.../redash/node_modules/puppeteer
Output:
The chromium binary is not available for arm64:
If you are on Ubuntu, you can install with:
 apt-get install chromium-browser

Steps to Reproduce

  1. run yarn on MacBook with Apple Silicon

Any other info e.g. Why do you consider this to be a bug? What did you expect to happen instead?

Technical details:

@square-li
Copy link
Author

square-li commented Apr 12, 2024

My temporary solution:

Following this guide: puppeteer/puppeteer#6634 (comment)

OR TLDR:

add these to package.json file

"resolutions": {
    "puppeteer": "https://github.com/seanaye/puppeteer/releases/download/v5.5.0-apple-silicon/puppeteer-core-5.5.0-post.tgz"
},

@justinclift
Copy link
Member

justinclift commented Apr 13, 2024

@gaecoli From memory, you use macOS yeah?

If that's the case, then this ^^^ sounds like it'll be useful and we could add it to the package.json. 😄

@justinclift
Copy link
Member

@square-li Thanks heaps, that does sound useful. 😁

@square-li
Copy link
Author

From what I understand, that package is used for frontend automated test. If anyone who just wants to test and run the app, they shouldn't be blocked on this.

@gaecoli
Copy link
Member

gaecoli commented Apr 13, 2024

@gaecoli From memory, you use macOS yeah?

If that's the case, then this ^^^ sounds like it'll be useful and we add it to the package.json. 😄

image image

The same result.

@gaecoli
Copy link
Member

gaecoli commented Apr 13, 2024

@justinclift This seems to be a problem and we should look at how to fix it. 😄

@gaecoli
Copy link
Member

gaecoli commented Apr 13, 2024

puppeteer/puppeteer#6622

I have found some solutions, but it's best to allow users to install dependencies directly through yarn without doing any extra work.

@justinclift
Copy link
Member

No worries. It sounds like we should create an extra page on the wiki for people using macOS, so we can give people the macOS specific steps.

If there's not much difference to the main "Local dev setup" page then we don't have to include the whole thing, we can just tell people what differences to install first or something.

What do you reckon? 😄

@justinclift
Copy link
Member

If anyone who just wants to test and run the app ...

That kind of sounds like "people who just want to use the app rather than develop it". If that's what you're meaning (?), then for that situation we should probably extend the official setup.sh repository scripting to support macOS.

That might not be too hard. Not really sure yet though as I've not tried it. 😄

@justinclift
Copy link
Member

... it's best to allow users to install dependencies directly through yarn without doing any extra work.

Yeah, I think we're in agreement here. If we can update things to automatically work for people so they don't need to follow extra instructions, that would be best.

If "automatic" doesn't work though, then at least having extra instructions for macOS users is probably the right approach.

@gaecoli
Copy link
Member

gaecoli commented Apr 13, 2024

... it's best to allow users to install dependencies directly through yarn without doing any extra work.

Yeah, I think we're in agreement here. If we can update things to automatically work for people so they don't need to follow extra instructions, that would be best.

If "automatic" doesn't work though, then at least having extra instructions for macOS users is probably the right approach.

Ok

@square-li
Copy link
Author

@gaecoli From memory, you use macOS yeah?

If that's the case, then this ^^^ sounds like it'll be useful and we add it to the package.json. 😄

image image

The same result.

Sorry I was missing to mention you would need to install chromium for arm as well.

"brew install chromium" then modify the package.json solves my issue.

@justinclift
Copy link
Member

@square-li Any interest in creating a new page on the wiki with instructions for macOS users trying to get a dev environment set up? 😄

@square-li
Copy link
Author

@square-li Any interest in creating a new page on the wiki with instructions for macOS users trying to get a dev environment set up? 😄

For sure. I would love to.

@justinclift
Copy link
Member

Awesome, please do. You should already have the right permissions for making changes on the wiki, and if you hit issues or have questions then please ask here or anywhere else suitable. 😄

If Discord is your kind of thing, then we have a chat server for developers to discuss stuff. You're welcome to join it:

    https://discord.gg/tN5MdmfGBp

@wtfiwtz
Copy link

wtfiwtz commented Apr 19, 2024

On Node >=18:

PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 yarn add puppeteer
node node_modules/puppeteer/install.mjs

Based on this: puppeteer/puppeteer#6622 (comment)

I was also able to change @percy/agent to @percy/cli to resolve this but it broke some tests, so that needs more investigation time.

@justinclift
Copy link
Member

Cool, that looks potentially useful too. Thanks @wtfiwtz. 😄

@gaecoli
Copy link
Member

gaecoli commented Apr 19, 2024

Cool! This good to me.

@AndrewChubatiuk
Copy link
Collaborator

added PR #6912, which upgrades percy and cypress, which fixes this issue. please test it if it works for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants