TypeError: eosjs__WEBPACK_IMPORTED_MODULE_11___default.a.SignatureProvider is not a constructor
Getting this error after following the steps from documentation
You have to install eosjs@beta.
Remove old eosjs package
yarn remove eosjs
Install new package
yarn add eosjs@beta
I get this same problem when I am running 20.0.0-beta2. I have to explicitly instruct npm to install to use 20.0.0-beta1.
@gravitt8460 please reference the updated README for beta2, the syntax is now
import { JsSignatureProvider } from 'eosjs'
if you want to use the default Js Signature Provider during development. We wanted to clarify that this is a practice that should be avoided when releasing production builds, as keeping private keys within the context of the webpage is insecure.
Browser
Importing using ES6 module syntax in the browser is supported if you have a transpiler, such as Babel.
import { Api, JsonRpc, RpcError, JsSignatureProvider } from 'eosjs';
NodeJS
Importing using commonJS syntax is supported by node out of the box.
const { Api, JsonRpc, RpcError, JsSignatureProvider } = require('eosjs');
const fetch = require('node-fetch'); // node only; not needed in browsers
const { TextDecoder, TextEncoder } = require('text-encoding'); // node, IE11 and IE Edge Browsers
@c0d3ster do you have any docs on how to create a signature provider or somewhere you could point people looking to create their own? i can’t seem to get jssignatureprovider to work and from what i’ve read, don’t want to use that in production. any help is appreciated, thanks!
@crizzwald could you provide more details about your issues with using the default JsSignatureProvider? The default signature provider is a great starting point to get your application up and running with either hardcoded keys or keys based on user input. Getting the default signature provider working will allow you to focus on getting the other user/blockchain interactions production-ready then you can circle back around to a more secure signature provider solution