Closed 12101111 closed 5 years ago
Current version in crates.io have a link error while using the recent rust nightly.
https://github.com/rustwasm/wee_alloc/pull/56 fix this problem
lib.rs:
use wasm_bindgen::prelude::*; use web_sys::console; #[wasm_bindgen] pub fn init() { console::log_1(&format!("it run").into()); } #[global_allocator] static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
Cargo.toml
[dependencies] wasm-bindgen = "0.2" wee_alloc = "0.4.2" [dependencies.web-sys] version = "0.3" features = ["console"]
ERROR in ./pkg/wasm_test_bg.wasm Module not found: Error: Can't resolve 'env' in '/mnt/g/project/wasm_test/pkg' @ ./pkg/wasm_test_bg.wasm @ ./pkg/wasm_test.js @ ./index.js @ multi (webpack)-dev-server/client?http://localhost:8080 ./index.js
in wasm file
(import "env" "llvm.wasm.grow.memory.i32" (func $llvm.wasm.grow.memory.i32 (type $t2)))
Release a new version to crates.io
@12101111 the new version has been released https://crates.io/crates/wee_alloc
This issue can be closed as soon as #79 is merged.
Summary
Current version in crates.io have a link error while using the recent rust nightly.
https://github.com/rustwasm/wee_alloc/pull/56 fix this problem
Steps to Reproduce
lib.rs:
Cargo.toml
Actual Results
in wasm file
Expected Results
Release a new version to crates.io