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

This module doesn't work anymore #206

Open
Kreijstal opened this issue Oct 7, 2022 · 9 comments
Open

This module doesn't work anymore #206

Kreijstal opened this issue Oct 7, 2022 · 9 comments
Labels
bug Something isn't working

Comments

@Kreijstal
Copy link

I mean it dependencies have updated A lot and there are many breaking changes

webpack              ^4.29.3  →  ^5.74.0
webpack-cli           ^3.1.0  →  ^4.10.0
webpack-dev-server    ^3.1.5  →  ^4.11.1

I guess you shouldn't have used webpack then 😝
simply use --target web I suppose.

@derdrdirk
Copy link

You can still run it using

node v12.22.12
npm 6.14.16

I used nvm install 12 and nvm use 12 to quickly install node 12.

@jack-mil
Copy link

Yes this template needs to be either updated or the tutorial and web book on rust+wasm (game of life) should not recommend this template. I have had to switch to using --target web instead

@adazoulay
Copy link

Has anyone found any good alternatives?

@olaitanade
Copy link

Please look at the changes in this PR-208 which helps resolve this issue.

@ratulb
Copy link

ratulb commented Feb 11, 2024

With latest Node version: v20.11.0 and following dependencies it runs clean.
package.json:

"dependencies": {
"wasm-game-of-life": "file:../pkg"
},
"devDependencies": {
"copy-webpack-plugin": "^12.0.2",
"webpack": "^5.90.1",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
}

And webpack.config.js should be replaced with:

const CopyPlugin = require("copy-webpack-plugin");
const path = require('path');

module.exports = {
entry: "./bootstrap.js",
output: {
path: path.resolve(__dirname, "dist"),
filename: "bootstrap.js",
},
mode: "development",
experiments: {
syncWebAssembly: true // Enable WebAssembly experiments
},
plugins: [
new CopyPlugin({
patterns: [
{ from: "index.html", to: "index.html" }
]
})
],
};

@anranlee99
Copy link

what @ratulb suggested works. is this project not supported anymore?

@Kreijstal
Copy link
Author

Seems this book is unmantained

@deanbear
Copy link

my solution (it's weird but works for me):

on your wasm-game-of-life directory,

  1. npm install -g create-wasm-app
  2. new a package.json file in root dir:
{
  "dependencies": {
    "create-wasm-app": "/usr/local/lib/node_modules/create-wasm-app"
  }
}
  1. npm install
  2. npm init wasm-app www
  3. 🦀 Rust + 🕸 Wasm = ❤

my environment:

npm verbose os Darwin 21.6.0
npm verbose node v22.5.1
npm verbose npm  v10.8.2

@davelet
Copy link

davelet commented Sep 14, 2024

my solution (it's weird but works for me):

on your wasm-game-of-life directory,

  1. npm install -g create-wasm-app
  2. new a package.json file in root dir:
{
  "dependencies": {
    "create-wasm-app": "/usr/local/lib/node_modules/create-wasm-app"
  }
}
  1. npm install
  2. npm init wasm-app www
  3. 🦀 Rust + 🕸 Wasm = ❤

my environment:

npm verbose os Darwin 21.6.0
npm verbose node v22.5.1
npm verbose npm  v10.8.2

works for me but you have to change the folder of create-wasm-app to /Users/YOUR_NAME/.nvm/versions/node/v22.8.0/lib/node_modules/create-wasm-app if you're under nvm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants