From 8a969e0cc115601edc9a20d93dced6c7f4cc15b3 Mon Sep 17 00:00:00 2001 From: Moaz bin Mokhtar Date: Fri, 18 Aug 2023 18:40:06 +0300 Subject: [PATCH 1/3] ref: update devDependencies with latest version to avoid error [DEP0111] DeprecationWarning --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index d21d358..93f6602 100644 --- a/package.json +++ b/package.json @@ -27,10 +27,10 @@ }, "homepage": "https://github.com/rustwasm/create-wasm-app#readme", "devDependencies": { + "copy-webpack-plugin": "^11.0.0", "hello-wasm-pack": "^0.1.0", - "webpack": "^4.29.3", - "webpack-cli": "^3.1.0", - "webpack-dev-server": "^3.1.5", - "copy-webpack-plugin": "^5.0.0" + "webpack": "^5.88.2", + "webpack-cli": "^5.1.4", + "webpack-dev-server": "^4.15.1" } -} +} \ No newline at end of file From 3c662143364f0b06ed92424fabac00e2e5f126b9 Mon Sep 17 00:00:00 2001 From: Moaz bin Mokhtar Date: Fri, 18 Aug 2023 18:40:27 +0300 Subject: [PATCH 2/3] doc: added guide to fix [DEP0111] DeprecationWarning issue and update devDependencies versions --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index d658bb1..45b5324 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,28 @@ Rust-generated WebAssembly and using them to create a Website. npm init wasm-app ``` +**Note** +You may face error like below: +```shell +(node:257464) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated. +(Use `node --trace-deprecation ...` to show where the warning was created) +ℹ 「wds」: Project is running at http://localhost:8080/ +ℹ 「wds」: webpack output is served from / +node:internal/crypto/hash:69 + this[kHandle] = new _Hash(algorithm, xofLen); + ... +``` +That error because of `devDependencies` versions conflicted with you Node version. + +You can simply update `devDependencies` versions by below commands: +```shell +npm i -g npm-check-updates +ncu -u +npm install +``` +Reference: https://stackoverflow.com/a/16074029/8093348 + + ## 🔋 Batteries Included - `.gitignore`: ignores `node_modules` From 6aac8cd8d0d1ab98dbc5062e9cbaa1e7620c82f4 Mon Sep 17 00:00:00 2001 From: Moaz bin Mokhtar Date: Fri, 18 Aug 2023 18:57:34 +0300 Subject: [PATCH 3/3] fix: webpack 5 WebAssmebly must be activated manually. Ref: https://webpack.js.org/configuration/experiments/ --- webpack.config.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 80ad814..31f0275 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -9,6 +9,13 @@ module.exports = { }, mode: "development", plugins: [ - new CopyWebpackPlugin(['index.html']) + new CopyWebpackPlugin({ + patterns: [ + { from: 'index.html' } + ] + }) ], + experiments: { + asyncWebAssembly: true, + } };