Closed BrunoLaporte closed 1 month ago
@BrunoLaporte We will verify the code and get back to you
I have verified the script, The code is working for me.
Please update the extension to the latest version - 2.24.13
and try again
Just updated my environment vscode version: 1.92.0 node version: 20.14.0 extension version: v2.24.13
Same error. I have the pre-request script configured in the yellow folder on the image if this changes anything for the request.
FYI, my collection and environments were erased when I activated the git sync feature. I started from scratch creating my same request and environments. I still have the same error.
You need to copy existing data from default location to git project See Note 3 in below link https://docs.thunderclient.com/team
Node modules try running below code and share logs
console.log("load node module");
var moment = await tc.loadModule("moment");
// use moment specific version
var moment = await tc.loadModule("moment", "2.30.0");
console.log(moment().format());
I reinstalled node on WSL and it works now !
Describe the bug I'm having trouble importing a Node library in a folder inline script. It is worth noting I just got a paid licence through my organization before trying this.
I have this error when running a query : Error in Pre Request Script: - moment is not a function
Here's the code :
Please let me know what I'm doing wrong I followed the documentation here : https://docs.thunderclient.com/scripting/libraries
Thanks in advance
To Reproduce Add code as above in folder pre-request script Launch request in said folder get error
Expected behavior I expected moment to work and format the date/time
Platform:
Are you using the free version/paid version/trial: paid