-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
[BUG] Chromium works in dev but fails at build (Executable doesn't exist) #18955
Comments
@MuhammadM1998 I see you are using chromium from |
@dgozman Would you mind suggesting an alternative to fix the base error then? I used 'chrome-aws-lambda' because I couldn't find an official solution that works. I think you shouldn't close an issue this fast too imo |
Sure! But I didn't understand the base issue, unfortunately. Could you explain please? |
@dgozman using the official package This is a similar question on SO and he used the same package to solve the problem. These are all similar issues in the playwright repo like #1568, #634, #626 #2404 suggests using the |
@MuhammadM1998 Playwright is focused on testing scenarios, so running it outside of local/CI environments is out of the project scope, sorry! However, |
I tried this too but didn't work. Thanks for helping out anyway If I found a solution I'll post it here |
Closing as per above. |
Any luck here, @MuhammadM1998? |
@ikamanu Didn't touch it in a while but last thing I remember is now it works in build and hangs in dev 😂 |
I faced the same issue recently, with the small difference that it was on AWS Lambda, running a Python environment. The solution was the following: ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
RUN playwright install --with-deps chromium On the code, add two flags: After these changes, I was able to use Playwright on AWS Lambda successfully. |
Hello! I'm encountering the same issue. Do you think you could review my Dockerfile? The difference is that I'm using AdonisJS, which is based on Node.js, so the distinction isn't significant. I asked a question. url issue |
Have you tried the suggestion I mentioned? I think it might work in your case since your error is also about not finding the executable. |
Thank you very much for your advice. My usage scenario is the same as yours. I tried adding the command you wrote to the Dockerfile, but it seems that another error occurred. I wonder if you have the same experience. BrowserType.launch_persistent_context: Executable doesn't exist at /home/sbx_user1051/.cache/ms-playwright/chromium-1148/chrome-linux/chrome... This Docker image can run normally in my local test, but this error will occur after deploying to AWS. I don't know why this is happening. The following is my Dockerfile. `ARG FUNCTION_DIR="/function" FROM python:3.11-slim AS build-image ARG FUNCTION_DIR RUN mkdir -p ${FUNCTION_DIR} RUN pip install FROM python:3.11-slim ARG FUNCTION_DIR WORKDIR ${FUNCTION_DIR} COPY requirements.txt ./ RUN pip install -r requirements.txt --target ${FUNCTION_DIR} ENV PLAYWRIGHT_BROWSERS_PATH=/tmp/ms-playwright RUN pip install playwright==1.49.0 COPY --from=build-image ${FUNCTION_DIR} ${FUNCTION_DIR} ENTRYPOINT [ "/usr/local/bin/python", "-m", "awslambdaric" ] CMD [ "lambda_function.handler" ]` |
@Yeqishen Based on the error you are getting it seems Playwright is still trying to install the browser in the default location and not on the path |
Context:
Reproduction
Repo , Stackblitz
Code Snippet
Describe the bug
I'm using Playwright in a
Nuxt 3
project as a nitro plugin to scrape data from a website then use it in the frontend.It works in my local maching but not in production or stackblitz (see reproduction link).
I've tried to implement this #2321 comment and it didn't work too.
Vercel Deployment logs
This is what's logged when deploying the repo mentioned above
The text was updated successfully, but these errors were encountered: