diff --git a/docs/src/tutorials/hybrid-applications-with-webpack/using-your-library.md b/docs/src/tutorials/hybrid-applications-with-webpack/using-your-library.md index f182f6db..3c51d2c8 100644 --- a/docs/src/tutorials/hybrid-applications-with-webpack/using-your-library.md +++ b/docs/src/tutorials/hybrid-applications-with-webpack/using-your-library.md @@ -55,13 +55,15 @@ pub fn run() -> Result<(), JsValue> { } ``` -Now, open up the `js/index.js` file. We see our Rust-generated wasm `run` function being +Now, open up the `js/index.js` file. We see our Rust-generated wasm `main_js` function being called inside our JS file. ```js -import("../crate/pkg").then(module => { - module.run(); -}); +import("../pkg/index.js") + .then((module) => { + module.main_js(); + }) + .catch(console.error); ``` ## Run The Project