Open kkongling opened 3 years ago
Hello,
This error complains about Chromium not being able to launch, this is a known bug on Node alpine images see here, this will not be fixed on the alpine linux-based image, but I'll introduce a new tag with debian-based images to fix this bug
I am building from ubuntu:
docker pull ubuntu:18.04
docker run -it -v /path/to/slidev:/root/slidev -p 3030:3030 ubuntu:18.04 /bin/bash
In container:
apt update
apt install -y curl
curl -fsSL https://deb.nodesource.com/setup_15.x | bash -
apt install -y nodejs
apt install -y chromium-browser
npm install @slidev/cli @slidev/theme-default
npm install playwright-chromium playwright
npx slidev export
Got err log:
Slidev v0.9.8
theme @slidev/theme-default
entry /root/slidev/demo/slides.md
browserType.launch: Failed to launch chromium because executable doesn't exist at /root/.cache/ms-playwright/chromium-878941/chrome-linux/chrome
Try re-installing playwright with "npm install playwright"
Error
at Object.captureStackTrace (/root/slidev/demo/node_modules/playwright-chromium/lib/utils/stackTrace.js:50:19)
at Connection.sendMessageToServer (/root/slidev/demo/node_modules/playwright-chromium/lib/client/connection.js:65:48)
at Proxy.<anonymous> (/root/slidev/demo/node_modules/playwright-chromium/lib/client/channelOwner.js:64:61)
at /root/slidev/demo/node_modules/playwright-chromium/lib/client/browserType.js:60:67
at BrowserType._wrapApiCall (/root/slidev/demo/node_modules/playwright-chromium/lib/client/channelOwner.js:77:34)
at BrowserType.launch (/root/slidev/demo/node_modules/playwright-chromium/lib/client/browserType.js:51:21)
at exportSlides (/root/slidev/demo/node_modules/@slidev/cli/dist/export-WGBEP3OU.js:62:34)
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at async Object.handler (/root/slidev/demo/node_modules/@slidev/cli/dist/cli.js:212:12)
I want to run slidev in container, and export pdf file. Any suggestion?
@kkongling Sorry for the wait, issue is on the way of being fixed
@Stig124 there seem to be a few commits on the dev
branch, are you still working on this or is the issue waiting on contributions?
This Dockerfile can resolve this issue.
FROM mcr.microsoft.com/playwright:focal
RUN yarn global add @slidev/cli
yarn create slidev
cd <project-directory>
yarn add playwright-chromium
yarn slidev export
command:
Got err log: