Open trueneu opened 1 week ago
Hi @trueneu,
Thanks for opening an issue. To help us replicate the issue, could you provide us with a working script that works in v0.52
and doesn't work in v0.53
of k6?
@ankur22 Sure thing, I'll have to spend some time to put together a minimal example with an instruction. If I upload it to a separate GitHub repo would that work for you?
Or do you want a compiled JS without the source?
@ankur22 , anyways, here's a repo with an example and a README to reproduce: https://github.com/trueneu/k6-bug
@ankur22 FWIW, I tried running against k6 built from your branch and it works, thank you very much! :)
We can close this now and reopen if it resurfaces for any reason, or close it after a new k6 version is released, whatever works.
Great news, @trueneu! Thanks for being proactive and checking against your own scripts 😄 🎉 The fix will make it into the next release, so you should be able to work with that instead of a custom build once that has been released.
Brief summary
Starting from k6 v0.53, it is not possible to call any
http
methods from ClojureScript for no obvious reason. It seems that imports stopped working correctly.k6 version
v0.53, v0.54
OS
Ubuntu 22.04
Docker version and image (if applicable)
No response
Steps to reproduce the problem
I am using shadow-cljs to compile ClojureScript with the following relevant configuration:
Then, I import
k6/http
(the results are the same):k6 v0.52 will make an http call if I do
However, starting from v0.53, it complains there's no such method.
If I do
(js/Object.keys http)
, with v0.52 everything's fine:With v0.53 onwards, it's either an empty array (regular require), or this ($default require):
If I perform the same from TypeScript code, everything's fine with the new version.
Basically, imports from ClojureScript don't work anymore. All things given, I assume this is a regression from v0.52 behaviour.
Could something change in the runtime ESM support that breaks this between the v0.52 and v0.53? I see CJS/ESM related breaking changes listed for v0.53, but I don't quite understand from the description how they are related.
Thomas Heller, the author of shadow-cljs, was kind to provide his expertise and has debugged it with me, but he also has no idea why this doesn't work as the code emitted by shadow-cljs should work if ESM is implemented correctly by the runtime.
Expected behaviour
k6/http
is imported correctly and all the methods are callable.Actual behaviour