b1f6c1c4/draw.io-export

Issue when running in an alpine docker container

Closed this issue · 2 comments

I've been attempting to get this running in an alpine docker container and I'm getting occasional errors, it doesn't happen every time the tool is run.

Error: Evaluation failed: ReferenceError: Graph is not defined
    at render (https://www.draw.io/export3.html:36:16)
    at __puppeteer_evaluation_script__:1:11
    at ExecutionContext.evaluateHandle (/home/.npm-global/lib/node_modules/puppeteer/lib/ExecutionContext.js:106:13)
    at process._tickCallback (internal/process/next_tick.js:68:7)

I'm using a patch to get puppeteer running on the base alpine image by getting chromium from apk and using puppeteer 1.8.0.

@@ -54,6 +54,8 @@
 
   const browser = await puppeteer.launch({
     headless: true,
+    executablePath: '/usr/bin/chromium-browser',
+    args: ['--no-sandbox', '--disable-dev-shm-usage'],
   });

Is this a draw.io-export issue or a puppeteer one?

I cloned my repo, applied your patch, and tried the following Dockerfile:

FROM alpine
RUN apk add nodejs yarn chromium
WORKDIR /root
COPY package.json yarn.lock ./
RUN yarn
COPY . .

It works like charm...

Potential problem:

  • Try bump math jax version 22ae399
  • Try simpler draw.io files first

Cloned the git (with commit 22ae399) and ran with that Dockerfile, works perfectly! Thanks!