Unable to wrap a Rust function from Emscripten

I am following this guide to getting started with Rust and WebAssembly but get the error "CWrap was not exported" when executing the code. I am using:

  • Webpack 4.1.1
  • Emscripten: 1.37.35

See stack trace and error below:

uncaught exception: abort("'cwrap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") at U@http://localhost:8080/bundle.js:1:320653
L@http://localhost:8080/bundle.js:1:320804
Ft@http://localhost:8080/bundle.js:1:423456
initialize/</c.cwrap@http://localhost:8080/bundle.js:1:412751
@http://localhost:8080/bundle.js:1:423791