Closed dnaicker closed 3 years ago
Hello @dnaicker. It looks like the problem is in the build process it self and the way in which order the packages are loaded. Did you checked/tried the configuration in the notice on the page you are linked (under 1.1 point)?
To use the library in a browser or a react native environment additional polyfilling is required. For an example of integrating this library with a react native application, please see the Jolocom SmartWallet metro configuration.
If not - pleas check and tell if that helps...
Right away I think that issue can be resolved by declaring the global Buffer
variable in the file, where @jolocom/vaulted-key-provider
is used. Like this:
global.Buffer = global.Buffer || require('buffer').Buffer
But it looks a bit hacky and I think there is more appropriate way to resolve this issue, will get back to this when will have some time...
@serg-temchenko Thank you for responding to my issue. I have used the metro file https://github.com/jolocom/smartwallet-app/blob/develop/metro.config.js in root of application folder, it resolved previous build errors.
Thank you again much appreciated.
Issue seems to be resolved.
@serg-temchenko Thank you soo much! I was just wondering how do I get the latest build? I did an npm update but it did not download any new update.
Hey @dnaicker
Can you please provide package.json
line where defined jolocom-lib
dependency?
@serg-temchenko thanks for replying. The line is: "jolocom-lib": "^5.2.1",
@dnaicker thanks for the output.
It looks like you have installed the latest published version from the npm registry.
There are still couple of RC (release candidate) versions jolocom-lib-v5.2.2-rc2-gitpkg
, jolocom-lib-v5.2.2-rc3-gitpkg
, jolocom-lib-v5.3.0-rc5-gitpkg
which has been released as a git tags (not published on the npm).
Despite that you still can test those versions by changing: "jolocom-lib": "^5.2.1"
on "jolocom-lib": "jolocom/jolocom-lib#jolocom-lib-v5.3.0-rc5-gitpkg"
to use the latest RC tag.
@serg-temchenko thank you Serg for providing instructions on how to update. I have created a new project with expo cli, added "jolocom-lib": "jolocom/jolocom-lib#jolocom-lib-v5.3.0-rc5-gitpkg", confirmed that I do have the correct node module
but i receive the buffer error again:
my app.js file code is:
my package json is:
Describe the bug When creating a self sovereign identity using instructions from https://jolocom-lib.readthedocs.io/en/latest/gettingStarted.html Section 1.2 inside a React Native application: `import { walletUtils } from '@jolocom/native-core' import { SoftwareKeyProvider } from '@jolocom/vaulted-key-provider'
const password = 'secretpassword'
SoftwareKeyProvider.newEmptyWallet(walletUtils, 'id:', password).then(emptyWallet => { console.log(emptyWallet) }) `
To Reproduce Steps to reproduce the behavior:
const password = 'secretpassword'
SoftwareKeyProvider.newEmptyWallet(walletUtils, 'id:', password).then(emptyWallet => { console.log(emptyWallet) }) `
Expected behavior To create new empty wallet and log output to console of wallet creation.
Screenshots
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context I am using React-Native 0.64, Node version 14.17.3, Ubuntu 20