Skip to content

Commit

Permalink
Fetch WASM module from server root
Browse files Browse the repository at this point in the history
When using a frontend framework such as yew, client-side routing
necessitates that the wasm bundle be requested from an absolute URL
instead of a relative URL.
  • Loading branch information
Nate Mara committed Oct 23, 2019
1 parent 2ddd9bb commit e4f4eed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wasm_runtime_standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if( typeof Rust === "undefined" ) {
var wasm_instance = new WebAssembly.Instance( mod, instance.imports );
return instance.initialize( wasm_instance );
} else {
var file = fetch( "{{{wasm_filename}}}", {credentials: "same-origin"} );
var file = fetch( "/{{{wasm_filename}}}", {credentials: "same-origin"} );

var wasm_instance = ( typeof WebAssembly.instantiateStreaming === "function"
? WebAssembly.instantiateStreaming( file, instance.imports )
Expand Down

0 comments on commit e4f4eed

Please sign in to comment.