HTML script with .js source

I’m trying to run an html script that calls a .wasm and .js file, but without any luck. I’ve uploaded the .wasm and .js files to the database, but am not sure how to call them in the html code.

How might I do that?

Picture and HTML below.

<!DOCTYPE html>
<script src="wasm_exec.js"></script>
<script>
// Polyfill
if (!WebAssembly.instantiateStreaming) {
    WebAssembly.instantiateStreaming = async (resp, importObject) => {
        const source = await (await resp).arrayBuffer();
        return await WebAssembly.instantiate(source, importObject);
    };
}

const go = new Go();
WebAssembly.instantiateStreaming(fetch(".\\10seconds.wasm"), go.importObject).then(result => {
    go.run(result.instance);
});
</script>

hey @ethanrgleonard :wave:

You should upload the two files to your file manager and get their links, switch them in the code you have.

bdk_512x512 @Huseyin from Flusk | Discover the #1 Security and Monitoring Tool for Bubble

All right, I did that, and I definitely see a change, but it still doesn’t work.

The opening screen is supposed to be black and have some flashing words.

One thing I notice is that when I set the HTML element to display as an iFrame, it shows the black screen but no flashing words. No editors appear in the editor. This is odd, because the script is not set to display as an iFrame.

However, if I uncheck “Display as an iFrame” , I see a white screen and the error,
‘’’
Bug in custom html:
ReferenceError: Go is not defined
at :10:12
at b
‘’’

This is also odd, because the script works locally on my localhost.

Any ideas on how to fix?

That, I don’t know. But if you pass the file links, I can give it a shot too.

bdk_512x512 @Huseyin from Flusk | Discover the #1 Security and Monitoring Tool for Bubble

I appreciate that.

The .js:

https://dc021cc431b93d03482398282603be0a.cdn.bubble.io/f1716249058799x122519896889132340/wasm_exec.js

The wasm:

https://dc021cc431b93d03482398282603be0a.cdn.bubble.io/f1716249034406x170385035161532580/10seconds.wasm

I believe that asm file is too big and it is referring to some other files that are missing. That’s the best I can try. Good luck solving it :slight_smile:

bdk_512x512 @Huseyin from Flusk | Discover the #1 Security and Monitoring Tool for Bubble

This topic was automatically closed after 70 days. New replies are no longer allowed.