Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use cita-sdk-js in wechat-mini-program? #115

Open
clearloop opened this issue Apr 21, 2019 · 3 comments
Open

How to use cita-sdk-js in wechat-mini-program? #115

clearloop opened this issue Apr 21, 2019 · 3 comments
Assignees

Comments

@clearloop
Copy link

clearloop commented Apr 21, 2019

Tried two ways to import cita-sdk into wechat-mini-program:

bundle.js

require('../miniprogram_npm/@cryptape/cita-sdk/lib/bundle.js');
...
VM12449:1 thirdScriptError 
 sdk uncaught third Error 
 module "miniprogram_npm/@cryptape/cita-sdk/lib/bundle.js" is not defined 
 Error: module "miniprogram_npm/@cryptape/cita-sdk/lib/bundle.js" is not defined
...

miniprogram_npm

const CITASDK = require('@cryptape/cita-sdk');
...
 sdk uncaught third Error 
 module "miniprogram_npm/@cryptape/cita-sdk/web3" is not defined 
 Error: module "miniprogram_npm/@cryptape/cita-sdk/web3" is not defined
  • My Debug base library's version is 2.6.6
  • Both cita-sdk-js and wechat-developer-tools are the lastest

note

I saw node-gyp compiled while installing web3 and wechat-mini-program doesn't support c++ addon, if we can't use web3 in wechat-mini-program?

@juzhiyuan
Copy link

NervJS/taro#2851

@Keith-CY
Copy link
Contributor

I've not tried yet, but the bundle.js attach the SDK to window, which doesn't exist in mini-program.

I'll work on it in several days.

@juzhiyuan
Copy link

juzhiyuan commented Apr 23, 2019

@Keith-CY Tks :)

cc @tiannian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants