question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

running draw.io from local file system fails in Chrome and Electron

See original GitHub issue

Story: As a user I want to run draw.io locally, ideally also without an internet connection.

Using Chrome/Chromium

What I tried:

  1. I cloned the git repo and went to the war folder.
  2. I opened index.html or app.html using chrome.

What I expected: I expected to see the where-do-you-want-to-save screen and, afterwards, the draw.io application

What happened:

  • Chrome displayed the content of the index.html- page (Flowchart Maker and Online Diagram Software […] Loading… Please ensure JavaScript is enabled )
  • on the devtools console, I got
app.min.js:325 XMLHttpRequest cannot load file:///home/[somefolders]/draw.io/war/stencils.xml. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.mxXmlRequest.send @ app.min.js:325
app.min.js:325

Uncaught NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'file:///home/[somefolders]/draw.io/war/stencils.xml'.

I tried using Firefox instead, there it works without errors – I can use draw.io there without problems

(On Firefox 49.0, and Chromium 53.0.2785.143; running on Ubuntu 16.04 (64-bit))

Via HTTP-Server

What I tried: I tried to run draw.io on a local server (via python -m SimpleHTTPServer):

What happened

It worked in non of the browsers:

  • In Firefox: SSL_ERROR_RX_RECORD_TOO_LONG
  • In Chrome: ERR_SSL_PROTOCOL_ERROR
    while the server says: code 400, message Bad request version after some (base64?) encoded lines which start right after “/images/logo-confluence.png” is loaded.

(same browser versions and OS as above)

Via Electron

What I tried

  1. in the war folder, I ran npm install
  2. npm start

What happened: As on Chrome, it never got beyond the initial page as it seemed to be unable to access needed javascript files, e.g. file:///home/[somefolders]/mxgraph2/javascript/src/js/mxClient.js.

Note that the repo was cloned into file:///home/[somefolders]/draw.io/ initially, so the file looked for is not even searched for in the repo.


Sorry for the long issue, I hope the descriptions are clear enough. Also, if you need any more extensive log files, I can provide those too.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
jdittrichcommented, Oct 17, 2016

If you want to run draw.io locally you can:

  • Run it in Firefox by opening the index.html. You can add the index.html?offline=1 parameter to suppress the cloud based saving options.
  • Run it in Firefox or Chrome by
    1. Running a local http server (e.g. pythons python -m SimpleHTTPServer 8000) in the /war directory.
    2. Then open the draw.io’sindex.htmlwith the parameters offline=1 and https=0, (e.g. http://localhost:8000/index.html?offline=1&https=0)
0reactions
CholoTookcommented, Jun 25, 2020

Thanks for any help

Read more comments on GitHub >

github_iconTop Results From Across the Web

XMLHttpRequest blocked in draw.io Electron app
I am desperatly trying to code a plugin for Draw.io that will basically do a request to another website in order to get...
Read more >
Cannot open files from Drive? - Google Groups
Hello, the files in my drive are blank but they should open with draw.io. I double click them, i get the preview unavailable...
Read more >
Truly headless draw.io exports - fasterthanli.me
I've made that diagram using the draw.io desktop application, much like all the other diagrams I've made. It's an Electron app, which, ...
Read more >
Using Cypress - Cypress Documentation
There are many reasons why tests may fail in CI but pass locally. Some of these include: There is a problem isolated to...
Read more >
Solved: Draw.io plugin issue - Error saving file / Diagram...
1 accepted · clear cache and temporarily disable all browser extensions first), is saving working well? · console can be opened in Chrome...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found