Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGL example seems broken #2894

Open
mousetail opened this issue May 15, 2022 · 3 comments
Open

WebGL example seems broken #2894

mousetail opened this issue May 15, 2022 · 3 comments
Labels

Comments

@mousetail
Copy link

Describe the Bug

The page of the webGL example seems blank. It shows the following error for me on Firefox 99: (Majaro Linux)

TypeError: _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__.memory is undefined
    <anonymous> webpack:///./pkg/index_bg.js?:434
    a https://rustwasm.github.io/wasm-bindgen/exbuild/webgl/index.js:119
    <anonymous> webpack:///./pkg/index_bg.js?:1
    js https://rustwasm.github.io/wasm-bindgen/exbuild/webgl/pkg_index_js.index.js:28
    __webpack_require__ https://rustwasm.github.io/wasm-bindgen/exbuild/webgl/index.js:42
    <anonymous> webpack:///./pkg/index_bg.wasm?:53
    a https://rustwasm.github.io/wasm-bindgen/exbuild/webgl/index.js:119
    <anonymous> webpack:///./pkg/index_bg.wasm?:51
    wasm https://rustwasm.github.io/wasm-bindgen/exbuild/webgl/pkg_index_js.index.js:38
    __webpack_require__ https://rustwasm.github.io/wasm-bindgen/exbuild/webgl/index.js:42
    <anonymous> webpack:///./pkg/index.js?:50
    a https://rustwasm.github.io/wasm-bindgen/exbuild/webgl/index.js:119
    <anonymous> webpack:///./pkg/index.js?:1
    js https://rustwasm.github.io/wasm-bindgen/exbuild/webgl/pkg_index_js.index.js:18
    __webpack_require__ https://rustwasm.github.io/wasm-bindgen/exbuild/webgl/index.js:42
    promise callback* webpack:///./index.js?:3
    js https://rustwasm.github.io/wasm-bindgen/exbuild/webgl/index.js:18
    __webpack_require__ https://rustwasm.github.io/wasm-bindgen/exbuild/webgl/index.js:42
    <anonymous> https://rustwasm.github.io/wasm-bindgen/exbuild/webgl/index.js:390
    <anonymous> https://rustwasm.github.io/wasm-bindgen/exbuild/webgl/index.js:392

If I try to run locally I get the following error:

 「wds」: Project is running at http://localhost:8080/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /home/mousetail/wasm-bindgen/examples/webgl
✖ 「wdm」: Error: Rust compilation.
    at ChildProcess.<anonymous> (/home/mousetail/wasm-bindgen/examples/webgl/node_modules/@wasm-tool/wasm-pack-plugin/plugin.js:225:16)
    at ChildProcess.emit (node:events:527:28)
    at maybeClose (node:internal/child_process:1090:16)
    at Socket.<anonymous> (node:internal/child_process:449:11)
    at Socket.emit (node:events:527:28)
    at Pipe.<anonymous> (node:net:709:12)

Steps to Reproduce

  1. Go to https://rustwasm.github.io/wasm-bindgen/exbuild/webgl/
  2. See the error in the console

Expected Behavior

  • See the rendered example

Actual Behavior

  • Blank screen

If applicable, add screenshots to help explain your problem.

Additional Context

Add any other context about the problem here.

@mousetail mousetail added the bug label May 15, 2022
@jacopofar
Copy link

Same here in Firefox 100 on Fedora

It doesn't work in Chrome either, but the error is different:

TypeError: Cannot read properties of undefined (reading 'buffer')
    at eval (index_bg.js:434:88)
    at __webpack_require__.a (index.js:119:13)
    at eval (index_bg.js:1:21)
    at ./pkg/index_bg.js (pkg_index_js.index.js:28:1)
    at __webpack_require__ (index.js:42:42)
    at eval (index_bg.wasm:53:55)
    at __webpack_require__.a (index.js:119:13)
    at eval (index_bg.wasm:51:21)
    at ./pkg/index_bg.wasm (pkg_index_js.index.js:38:1)
    at __webpack_require__ (index.js:42:42)

@toadslop
Copy link

toadslop commented Jul 2, 2022

I think this could be an issue with the webpack plugin. I'm currently running my own project, not related to WebGL but I'm building using @wasm-tool/wasm-pack-plugin. When I try to run my code in the browser, I get the same error as @jacopofar :

TypeError: Cannot read properties of undefined (reading 'buffer')
    at Module.eval (index_bg.js:623:91)
    at eval (index_bg.js:627:30)
    at ./pkg/index_bg.js (index.js:603:1)
    at __webpack_require__ (index.js:64:30)
    at eval (index_bg.wasm:8:31)
    at ./pkg/index_bg.wasm (index.js:614:1)
    at __webpack_require__ (index.js:64:30)
    at eval (index.js:2:72)
    at ./pkg/index.js (index.js:591:1)
    at __webpack_require__ (index.js:64:30)

@Liamolucko
Copy link
Collaborator

I think that's caused by #2961, so it should be fixed with the git version of wasm-bindgen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants