-
Notifications
You must be signed in to change notification settings - Fork 3
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
Import crypto from k6/experimental/webcrypto capitalizes the names of some methods for a built-in object from http #55
Comments
I'm having the same issue k6 v0.48.0 (go1.21.5, darwin/arm64) |
Thanks for reporting this 🙇 I have moved the issue to the webcrypto repo, and now that it has been reported it is pretty easy to find that the issue is xk6-webcrypto/webcrypto/module.go Line 36 in 1ff651f
Given the commit it was added in 056c2f6 it looks like removing it will at least break xk6-webcrypto/webcrypto/test_setup.go Line 39 in 1ff651f
which makes the test a tad less useful. Removing both definitely breaks a bunch of tests. The issue here is that the It seems it is used for the same reason here in webcrypto. Unfortunately breaking k6 core API is a lot bigger problem. As such I do think webcrypto module should move away from using it and use a different workaround. In this case I guess that will be to create a simple goja Object and set properties on it, instead of using the automagical transformation of go object to goja ones. cc @grafana/k6-core and @oleiade specifically |
How do we get the latest version with this fix? |
@alecbar you can use the The fixes have been merged in then. The next k6 release is v0.49.0 and is expected in 2 weeks on the 29th. |
Brief summary
I'm working on a typescript project that includes the
k6/experimental/webcrypto
library. When I receive a response from the server, I use the built-in.json()
method and the following error occurs: "Uncaught (in promise) TypeError: Object has no member 'json'
". I decided to print out the methods of this object and got the following:Very strange behavior that took a long time to resolve, please look into this.
Here is some snippet:
If needed, I can attach the final js-bundles.
k6 version
k6 v0.48.0 (commit/47c0a26798, go1.21.4, linux/amd64)
OS
Ubuntu(WSL)/macOS
Docker version and image (if applicable)
No response
Steps to reproduce the problem
crypto
fromk6/experimental/webcrypto
Expected behaviour
The http response object's method names have not changed
Actual behaviour
The http response object's method names have changed
The text was updated successfully, but these errors were encountered: