You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JS Dash SDK works fine in the Node.js enviornment, but when we use it in the Frontend application (React / Webpack), we receive an unexpected error when we build our application in production mode.
The application successfully builds, and the code is able to import it without any issues, but when we try to retrieve an Identity from the Platform with the method client.platform.identities.get()
we get an error:
Error add client: Error: JS object constructor name mismatch. Expected Metadata, provided ID.
at I8.g.wbg.__wbindgen_error_new (09700834-76f73061e1ef0914.js:31:360137)
at wasm_dpp.wasm.wasm_dpp::utils::generic_of_js_val::h03ffdab2677d6d46 (2ecc9877-4e34-4b5a-938d-8f3f35d01955:0x2f6ca3)
at wasm_dpp.wasm.identity_setMetadata (2ecc9877-4e34-4b5a-938d-8f3f35d01955:0x3b6c30)
at A$.setMetadata (09700834-76f73061e1ef0914.js:31:211024)
at A.<anonymous> (09700834-76f73061e1ef0914.js:27:1083808)
at 09700834-76f73061e1ef0914.js:27:1083000
at Object.next (09700834-76f73061e1ef0914.js:27:1083105)
at E (09700834-76f73061e1ef0914.js:27:1081827)
However dev builds are all working just fine.
Possible Solution
I did a small debugging why this happens, and the problem happens in the JS Dash SDK's identities.get method. For unknown reason, the import line in the get.ts file : import { Identifier, Metadata } from '@dashevo/wasm-dpp';
does not work correctly in the production builds, and instead of Metadata class, ID class gets imported from the @dashevo/wasm-dpp
Issue
JS Dash SDK works fine in the Node.js enviornment, but when we use it in the Frontend application (React / Webpack), we receive an unexpected error when we build our application in production mode.
The application successfully builds, and the code is able to import it without any issues, but when we try to retrieve an Identity from the Platform with the method
client.platform.identities.get()
we get an error:
However dev builds are all working just fine.
Possible Solution
I did a small debugging why this happens, and the problem happens in the JS Dash SDK's
identities.get
method. For unknown reason, the import line in theget.ts
file :import { Identifier, Metadata } from '@dashevo/wasm-dpp';
does not work correctly in the production builds, and instead of
Metadata
class,ID
class gets imported from the@dashevo/wasm-dpp
Steps to Reproduce (for bugs)
frequent situate velvet inform help family salad park torch zero chapter right
Context
Your Environment
The text was updated successfully, but these errors were encountered: