samizdatco / arbor

a graph visualization library using web workers and jQuery
http://arborjs.org
2.66k stars 634 forks source link

Uncaught DOMException: Failed to construct 'Worker': #72

Open dcts opened 5 years ago

dcts commented 5 years ago

Hello! This code here works perfectly if you just copy & paste it in a .html file and open locally with a browser.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <h1>TEST</h1>
  <canvas id="viewport" width="800" height="500"></canvas>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
  <!-- run from the minified library file: -->
  <script src="https://dl.dropbox.com/s/y2msq2ttbxeu2qo/arbor.js"></script>
  <script src="https://dl.dropbox.com/s/578qe4k75xi9209/main.js"></script>
</body>
</html>

But when I host it on github or put inside my rails app i get the following error:

arbor.js:33 Uncaught DOMException: Failed to construct 'Worker': Script at 'https://dl.dropbox.com/s/y2msq2ttbxeu2qo/arbor.js' cannot be accessed from origin 'https://dcts.github.io'.
    at Object.init (https://dl.dropboxusercontent.com/s/y2msq2ttbxeu2qo/arbor.js:33:713)
    at Kernel (https://dl.dropboxusercontent.com/s/y2msq2ttbxeu2qo/arbor.js:33:3165)
    at Object.ParticleSystem (https://dl.dropboxusercontent.com/s/y2msq2ttbxeu2qo/arbor.js:35:8072)
    at HTMLDocument.<anonymous> (https://dl.dropboxusercontent.com/s/578qe4k75xi9209/main.js:154:21)
    at Object.resolveWith (https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js:16:15102)
    at Function.ready (https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js:16:10164)
    at HTMLDocument.z (https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js:16:14558)

Any ideas on how to resolve that? Here is the direct link which throws the error: https://dcts.github.io/arbor-js-test/index.html

Any help is very appreciated, I really love this library but just cant get it to work in production, which is super annoying. Thanks a lot in advance!

Roiocam commented 2 years ago

same issue, but https://cdnjs.cloudflare.com/ajax/libs/arbor/0.91.0/arbor.min.js work for me arbor.js was not