Git Product home page Git Product logo

miniprogram-rust-wasm-example's People

Contributors

lastleaf avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

miniprogram-rust-wasm-example's Issues

您好,测试了一个rust 第三方库,小程序调用失败

添加了md5 = "0.7.0"

use js_sys::*;
#[wasm_bindgen]
pub fn md5(data: JsValue) -> JsValue {
    let data: String = JsString::from(data).into();
    let digest = md5::compute(data.as_bytes());
    let hex: JsString = JsString::from(format!("{:x}", digest).as_str());
    JsValue::from(JsString::from(hex))
}

错误内容如下:

VM112 WAService.js:2 TypeError: fimport$0 is not a function
    at Object.$80 [as sum] (rust_mod_bg.wasm.js? [sm]:4053)
    at sum (rust_mod_bg.js? [sm]:126)
    at se.onLoad (index.js? [sm]:13)
    at se.<anonymous> (VM112 WAService.js:2)
    at se.c.__callPageLifeTime__ (VM112 WAService.js:2)
    at Le (VM112 WAService.js:2)
    at Ye (VM112 WAService.js:2)
    at Function.<anonymous> (VM112 WAService.js:2)
    at i.<anonymous> (VM112 WAService.js:2)
    at i.emit (VM112 WAService.js:2)
errorReport @ VM112 WAService.js:2
thirdErrorReport @ VM112 WAService.js:2
(anonymous) @ VM112 WAService.js:2
(anonymous) @ VM112 WAService.js:2
c.__callPageLifeTime__ @ VM112 WAService.js:2
Le @ VM112 WAService.js:2
Ye @ VM112 WAService.js:2
(anonymous) @ VM112 WAService.js:2
(anonymous) @ VM112 WAService.js:2
i.emit @ VM112 WAService.js:2
emit @ VM112 WAService.js:2
(anonymous) @ VM112 WAService.js:2
i.emit @ VM112 WAService.js:2
emit @ VM112 WAService.js:2
(anonymous) @ VM112 WAService.js:2
(anonymous) @ VM112 WAService.js:2
c @ VM8 asdebug.js:1
l @ VM8 asdebug.js:1
(anonymous) @ VM8 asdebug.js:1
f @ VM8 asdebug.js:1
g @ VM8 asdebug.js:1
(anonymous) @ VM8 asdebug.js:1
_ws.onmessage @ VM8 asdebug.js:1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.