You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Statically serve the without-a-bundler-no-modules directory and visit index.html using Safari.
Actual Behavior
The example doesn't load leaving an error in the developer console:
ReferenceError: Can't find variable: wasm_bindgen
Analysis
By loading generated pkg/without_a_bundler_no_modules.js:
letwasm_bindgen;
...
wasm_bindgen is expected to be globally exported, which works fine in Chrome/Firefox, but not in Safari. In case of Safari, the scoping behavior seems different; the let variable becomes scoped in the <script> block (a relevant case here).
As a workaround, should we update crates/cli-support/src/js/mod.rs so that it generates JS like the following instead?
varwasm_bindgen;
...
The text was updated successfully, but these errors were encountered:
Describe the Bug
We see an error in Safari when loading the
without-a-bundler-no-modules
example.Steps to Reproduce
git clone https://github.com/rustwasm/wasm-bindgen
cp -r wasm-bindgen/examples/without-a-bundler-no-modules .
cd without-a-bundler-no-modules
wasm-pack build --target no-modules
without-a-bundler-no-modules
directory and visit index.html using Safari.Actual Behavior
The example doesn't load leaving an error in the developer console:
Analysis
By loading generated pkg/without_a_bundler_no_modules.js:
wasm_bindgen
is expected to be globally exported, which works fine in Chrome/Firefox, but not in Safari. In case of Safari, the scoping behavior seems different; thelet
variable becomes scoped in the<script>
block (a relevant case here).As a workaround, should we update crates/cli-support/src/js/mod.rs so that it generates JS like the following instead?
The text was updated successfully, but these errors were encountered: