Problems integrating WebGL build with Meteor web platform

Hi,
We create a build of a WEBGL project to integrate in a page hosted in Meteor, but when we enter the page and Unity WebGl build start loading it generates a url like:

http%3A//localhost/aa6ebf3f-f9ff-44c3-855f-f032c9b6e711

and Meteor shows the next error in the console log:

"blob:http%3A//localhost%3A3000/2fc31e16-9294-484a-8f82-90046929515b:1
Uncaught SyntaxError: Unexpected token
<

The file itself contains a bunch of Unity stuff like:

Module[“preRun”].push((function(){var
unityFileSystemInit=Module[“unityFileSystemInit”]||(function(){window.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB;if(!window.indexedDB){console.log(“IndexedDB
is not available. Data will not
persist in cache and PlayerPrefs will
not be
saved.”)}FS.mkdir(“/idbfs”);FS.mount(IDBFS,{},“/idbfs”);

We have our Unity build in the public folder, and in localhost everything works just fine. What are we missing? How can we integrate it successfully?

Here is a photo with the generated file:
65300-generated-url.png

Thanks in advance!
PD: If you need more information just ask.

I’m also running into this error SyntaxError: Unexpected token <, not with Meteor but because my web server is set to return a HTTP 200 response for all failed (404) requests.

My Understanding of the Issue

  1. When UnityLoader.js sets up a WebGL build it creates DOM elements, e.g. <script src="blob:http://example.com/cf293059-9d5d-4f7b-abc1-372fdd19e69f" /> via the functions LoadJSCode() / LoadJSCodeBlob().
    The W3C FileAPI spec indicates this is a generated filename for the blob scheme: scheme ":" origin "/" UUID .

  2. These elements then trigger a network request for those files.

  • If that request returns a 404 NOT FOUND the blob is empty/unloaded.

  • If that request returns a 200 OK then the JS Blob element is filled with that data. UnityLoader.js believes the file is loaded/ready and tries to access it, then fails when it finds, say HTML data (hence < ) not webgl code/data.


So the correct solution seems to be to try and find a way to ensure your server setup returns a 404 for those generated files. :frowning: