You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a docker-compose env and added playwright to it. When I try to install it via docker (as part of a CI setup), the installation fails
UnhandledPromiseRejectionWarning: Error: Target directory is expected to be absolute
at module.exports (/src/wp-content/plugins/cm-herakles-plugin/public/client/node_modules/extract-zip/index.js:167:11)
at Object.downloadBrowserWithProgressBar (/src/wp-content/plugins/cm-herakles-plugin/public/client/node_modules/playwright/lib/install/browserFetcher.js:172:15)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async validateCache (/src/wp-content/plugins/cm-herakles-plugin/public/client/node_modules/playwright/lib/install/installer.js:103:9)
at async installBrowsersWithProgressBar (/src/wp-content/plugins/cm-herakles-plugin/public/client/node_modules/playwright/lib/install/installer.js:60:5)
As far as I understand extract-zip does not support relative paths since version 2.0. I searched for this issue and apparently no-one else encountered this problem with playwright. But my setup is not very special or complicated, so in theory it should apply to other docker-compose setups as well (?)
Install command is docker-compose run --rm --user 33:33 -e HOME=. playwright /bin/bash -c "cd src/wp-content/plugins/cm-herakles-plugin/public/client/ && npm ci && npm run test"
docker-compose
version: "3.3"
services:
# other service left out for brevity
playwright:
container_name: playwright
image: mcr.microsoft.com/playwright:bionic
shm_size: "2gb"
volumes:
- "wp_data:/src:rw"
- "config:/config:rw"
- "./test:/test:rw"
volumes:
config:
driver: local
driver_opts:
type: none
device: ${PWD}/config
o: bind
wp_data:
driver: local
driver_opts:
type: none
device: ${PWD}/src
o: bind
The text was updated successfully, but these errors were encountered:
The problem here is in HOME=. from. the command line. Playwright is installing browsers into the home directory, and we get the relative path - thus the error.
I'd overall advise against using relative HOME path because it will resolve to the different absolute path based on current working directory of any given program or (in our case) node script.
With #5406, this should probably work. However, we still advise to use absolute HOME env, e.g. HOME=$PWD to point to the current directory. Also, launching Firefox with relative HOME is not supported and will throw.
I have a docker-compose env and added playwright to it. When I try to install it via docker (as part of a CI setup), the installation fails
As far as I understand extract-zip does not support relative paths since version 2.0. I searched for this issue and apparently no-one else encountered this problem with playwright. But my setup is not very special or complicated, so in theory it should apply to other docker-compose setups as well (?)
Install command is
docker-compose run --rm --user 33:33 -e HOME=. playwright /bin/bash -c "cd src/wp-content/plugins/cm-herakles-plugin/public/client/ && npm ci && npm run test"
docker-compose
The text was updated successfully, but these errors were encountered: