Skip to content

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

@dcts

Description

@dcts

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions