Closed ColinSowul closed 4 months ago
Hi @ColinSowul
I just tested the below code its working for me, can you please update the extension to v2.20.1 and try again
var Chance = await tc.loadModule("chance");
var chance = new Chance();
console.log("firstName", chance.name());
Just updated my extension version to v2.20.1 but I'm still getting the error.
If it helps, I was also able to view more detailed logs in the console:
Script Log: Error loading node package: chance - Command failed: ..... c:\Users\Colin Sowul\.vscode\extensions\rangav.vscode-thunder-client-2.20.1\dist chance@latest
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\Colin Sowul\AppData\Local\Programs\Microsoft VS Code\Sowul\.vscode\extensions\rangav.vscode-thunder-client-2.20.1\dist/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\Colin Sowul\AppData\Local\Programs\Microsoft VS Code\Sowul\.vscode\extensions\rangav.vscode-thunder-client-2.20.1\dist\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
Thanks for sharing logs will verify and get back to you.
We made few changes to fix this issue, Can you please install the new update vsix
file manually and test it.
I installed that .vsix file but I'm still seeing the issue, with the same logs as well
I also tried updating the plugin to v2.20.3, but that isn't working either
Thanks for testing it. Will verify again and get back to you.
I have tested on windows 11 and windows 10 (with node 18.17.1) its working on both OS for me.
can you please restart your PC and test again?
May be it could be a permissions issue?
I've restarted my PC and ran VSCode as an administrator, but I'm still experiencing this issue. Also reached out to my coworkers and they seem to still be having this issue as well
Thanks for the confirmation.
v2.19.9
.Chance
node module manually in the extension installed pathCould we schedule a call for next week to investigate the issue?
Please contact us using the form below, providing your available dates and time slots https://www.thunderclient.com/contact
Hi Colin, I have fixed the issue, Can you please install the VSIX file manually and test it vscode-thunder-client-2.21.1.vsix.zip
Still getting the same error with that version
Can you please share the logs again, the paths should be different now
I have also published new version of cli - v1.13.4
can you please install latest update using cmd - npm i -g @thunderclient/cli
and test it.
Just tried the cli, got an error with that as well.
Here are the log outputs for the VSCode plugin and the CLI: VSCode:
Script Log: Error loading node package: chance - Command failed: Installing chance@latest
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\Colin Sowul\AppData\Local\Programs\Microsoft VS Code\Sowul\.vscode\extensions\rangav.vscode-thunder-client-2.21.1\dist/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\Colin Sowul\AppData\Local\Programs\Microsoft VS Code\Sowul\.vscode\extensions\rangav.vscode-thunder-client-2.21.1\dist\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in: C:\Users\Colin Sowul\AppData\Local\npm-cache\_logs\2024-04-15T18_43_48_211Z-debug-0.log
Error in Script: - Chance is not a constructor
CLI:
Script Log: Error loading node package: chance - Command failed: Installing chance@latest
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\Colin Sowul\Documents\git\allo-fiber-thunder-client\Sowul\AppData\Roaming\npm\node_modules\thunderclient-cli\dist/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\Colin Sowul\Documents\git\allo-fiber-thunder-client\Sowul\AppData\Roaming\npm\node_modules\thunderclient-cli\dist\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in: C:\Users\Colin Sowul\AppData\Local\npm-cache\_logs\2024-04-15T21_20_53_281Z-debug-0.log
Error in Script: - Chance is not a constructor
@ColinSowul I have made few more changes to fix this. Can you please test the v2.21.2
version below
That fixed it, my pre-request script & request are running successfully with that version
Finally, we fixed this. Thanks for the confirmation. I have published the update to the marketplace.
Describe the bug Currently, when attempting to load Chance from npm, an error occurs when constructing the main object that offers Chance apis:
Error in Pre Request Script: - Chance is not a constructor
The code I'm using the create an Chance object matches the ThunderClient documentationTo Reproduce Add this code block to a Pre-Request script of a request and run it:
Expected behavior The main object from the chance library is instantiated and can be used
Platform:
Are you using the free version/paid version/trial: paid version