Skip to content
New issue

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

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

Already on GitHub? # to your account

fix(sample/browser): TypeError: Reflect.get called on non-object #49

Closed
petermetz opened this issue Sep 8, 2020 · 7 comments · Fixed by #51
Closed

fix(sample/browser): TypeError: Reflect.get called on non-object #49

petermetz opened this issue Sep 8, 2020 · 7 comments · Fixed by #51

Comments

@petermetz
Copy link
Contributor

To reproduce:

  1. Clone my fork's branch (fix(sample): update references to generateBls12381G2KeyPair #48) that has the key pair generation function names fixed (otherwise the sample will stop working there)
  2. Run the browser samples as instructed by the readme file under ./sample/browser
  3. Observe the crash

Chrome Dev Tools Logs:

localhost/:1 Uncaught (in promise) Error(JsValue(TypeError: Reflect.get called on non-object
TypeError: Reflect.get called on non-object
    at Object.get (<anonymous>)
    at Module.eval (webpack:////home/peter/a/blockchain/bbs-signatures/pkg/index_bg.js?:644:23)
    at Module.eval (webpack:////home/peter/a/blockchain/bbs-signatures/pkg/index_bg.js?:451:22)
    at __wbg_get_2e96a823c1c5a5bd (http://localhost:8080/bbs-signatures.min.js:149:102)
    at js_sys::Reflect::get::hdb44b494eb45724a (http://localhost:8080/294ad96f2bf83bcad951.module.wasm:wasm-function[1000]:0x1b98b7)
    at js_sys::try_iter::hb9f6985e5939da27 (http://localhost:8080/294ad96f2bf83bcad951.module.wasm:wasm-function[260]:0x155380)
    at <serde_wasm_bindgen::de::Deserializer as serde::de::Deserializer>::deserialize_seq::h8a61401663b55dff (http://localhost:8080/294ad96f2bf83bcad951.module.wasm:wasm-function[335]:0x1665a5)
    at serde::de::impls::<impl serde::de::Deserialize for alloc::vec::Vec<T>>::deserialize::h1a24def40ef00233 (http://localhost:8080/294ad96f2bf83bcad951.module.wasm:wasm-function[5448]:0x240a27)
    at <core::marker::PhantomData<T> as serde::de::DeserializeSeed>::deserialize::hbf6636bd759ab427 (http://localhost:8080/294ad96f2bf83bcad951.module.wasm:wasm-function[5478]:0x24107b)
    at <serde_wasm_bindgen::de::SeqAccess as serde::de::SeqAccess>::next_element_seed::h2d960dcb668c8169 (http://localhost:8080/294ad96f2bf83bcad951.module.wasm:wasm-function[354]:0x16a3fc)))

With Dev Tools "Pause on Exception" this is where it goes sideways:

image

@tplooker
Copy link
Member

tplooker commented Sep 8, 2020

Addressed in #48

@tplooker tplooker closed this as completed Sep 8, 2020
@petermetz
Copy link
Contributor Author

Addressed in #48

@tplooker Sorry, I may not have been entirely clear here in the description. This issue is not resolved by #48 but is rather unmasked by it. E.g., in my quest to make the sample work, I first encountered the function name issue (which I fixed) and then afterwards I hit the issue described here (and did not immediately know what the cause might be so I just opened this bug).

@tplooker tplooker reopened this Sep 8, 2020
@tplooker
Copy link
Member

tplooker commented Sep 8, 2020

Apologies @petermetz thanks for the clarification

@tplooker
Copy link
Member

tplooker commented Sep 8, 2020

@petermetz on further investigation this issue is being caused by the change in the data type for messages member in the sign request from string[] to Uint8Array[] as reported in the latest release see #40 for the PR that made the change

@tplooker
Copy link
Member

tplooker commented Sep 9, 2020

See the latest tests for an example on how to update them

petermetz added a commit to petermetz/bbs-signatures that referenced this issue Sep 9, 2020
Fixes mattrglobal#49

Signed-off-by: Peter Somogyvari <peter.metz@unarin.com>
@petermetz
Copy link
Contributor Author

See the latest tests for an example on how to update them

Thanks @tplooker that helped a lot. Sent a PR with the sample fixed in it.

tplooker pushed a commit that referenced this issue Sep 9, 2020
Fixes #49

Signed-off-by: Peter Somogyvari <peter.metz@unarin.com>
@tplooker
Copy link
Member

tplooker commented Sep 9, 2020

Thanks @petermetz! Appreciate the contribution.

kdenhartog pushed a commit that referenced this issue Sep 10, 2020
This locks the sample for bbs-signatures in a browser to be specific to v0.4.0 now

re #49
tplooker added a commit that referenced this issue Sep 10, 2020
* chore: update samples to work with version 0.4.0

The API changed on the samples from being strings of messages to being Uint8Array of messages.
Additionally the type for nonce was changed from string to Uint8Array. This update supports the new
API as of v0.4.0

re #50

* docs: updates README.md examples to match v0.4.0 API

re #50

* fix: update browser samples to support fixed bbs-signatures v0.4.0

This locks the sample for bbs-signatures in a browser to be specific to v0.4.0 now

re #49

Co-authored-by: Tobias Looker <tobias.looker@mattr.global>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants