create-wasm-app icon indicating copy to clipboard operation
create-wasm-app copied to clipboard

Tutorial issue section 4.4

Open brianharnish opened this issue 5 years ago • 1 comments

Rust newbie here, Just following the tutorial and I've reached midway through section 4.4 where I've run into a weird issue. I try building the project and running npm run start, that's when I got the error message: ERROR in ./index.js 1:20 Module parse failed: Unexpected token (1:20) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

import { Universe } as wasm from "wasm-game-of-life"; | const pre = document.getElementById("game-of-life-canvas"); | const universe = Universe.new(); @ ./bootstrap.js 4:0-20

How would I fix this issue?

brianharnish avatar Jun 05 '20 15:06 brianharnish

Omit the as wasm:

import { Universe } from "wasm-game-of-life";

ChayimFriedman2 avatar Feb 17 '21 10:02 ChayimFriedman2