-
Notifications
You must be signed in to change notification settings - Fork 211
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
Universe.new is not a function #211
Comments
I have the same error. Even the typescript definition file doesn't have all Universe's pub methods defined:
Don't know from where |
The root of this problem is in this block of code:
What is missing here is |
Awesome, just got me unstuck. To add on to this, |
Thanks @tadejstanic |
When I do the tutorial, it gives me an error if I add the #[wasm_bindgen] line. If I don't add it the program compiles, but it doesn't work. Nothing is displayed on screen. When I compile the program with #[wasm_bindgen], it does work in the first part of the tutorial with the <pre> but it doesn't work where it is rendered to the <canvas>. What should I do? |
This is definitely the same issue as #265 Linking them to "link all the things" |
As for the canvas part of the issue, it worked for me. |
One thing that can cause this problem is forgetting to run I did this tutorial over multiple days and forgot that was a thing. It produces the same error as OP is describing. |
Describe the bug
In the implementing life section I've ran into this error when trying to create a new Universe from the wasm-game-of-life package:
Error importing
index.js
: TypeError: "wasm_game_of_life__WEBPACK_IMPORTED_MODULE_0__.Universe.new is not a function"To Reproduce
Follow the tutorial as described
Expected behavior
It is supposed to show the Universe rendered into the html page but I receive the error as stated above
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Error importing
index.js
: TypeError: "wasm_game_of_life__WEBPACK_IMPORTED_MODULE_0__.Universe.new is not a function"webpack:///./index.js?:6
js http://localhost:8080/0.bootstrap.js:34
webpack_require http://localhost:8080/bootstrap.js:81
bootstrap.js:5:23
webpack:///./bootstrap.js?:5
The text was updated successfully, but these errors were encountered: