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
The JS statement import whatever from "https://jslib.k6.io/url/1.0.0/index.js"; import the lib, and stores its defaults export into whatever variable, and this variable is not used.
This even works with multiple files: if I have 3 files A, B and C using new URL, if only file A import the jslib url, both B and C files can use the new URL syntax without explicitly importing the lib.
The text was updated successfully, but these errors were encountered:
Hello,
In the lib documentation, you instruct to import the jslib url to use the
new URL
syntax, and it works as expected:The log line
msg="url \"http://example.com/\"
proves it worked.When I comment the import statement, I get an expected error
ReferenceError: URL is not defined
, that's okay:Things are getting strange when I import the lib but with a different syntax (
import whatever from "https://jslib.k6.io/url/1.0.0/index.js";
):The JS statement
import whatever from "https://jslib.k6.io/url/1.0.0/index.js";
import the lib, and stores its defaults export intowhatever
variable, and this variable is not used.But then, the
new URL
works ! Like if theURL
was added in a global namespace when the https://jslib.k6.io/url/1.0.0/index.js file is executed.This even works with multiple files: if I have 3 files A, B and C using
new URL
, if only file A import the jslib url, both B and C files can use thenew URL
syntax without explicitly importing the lib.The text was updated successfully, but these errors were encountered: