apideck-libraries/postman-to-k6

The moduleSpecifier "../../libs/shim/urijs.js" couldn't be found on local disk.

CMathgician opened this issue · 9 comments

image

Similar to this issue before: grafana/postman-to-k6#78
I changed the import "../../libs/shim/urijs.js"; on requests into import "../libs/shim/urijs.js";
and it runs well

hi @CMathgician

Could you provide me an example of which CLI parameters you are using?
And if possible the Postman collection JSON.

The issue should have been fixed a year ago and I want to be able to reproduce it.

@thim81 Sorry, I can't share the collection.
But here is the command that I use:
npx @apideck/postman-to-k6 svc-sms/internal.json --separate true -o svc-sms/internal-script.js

and here the folder structure looks like after running that command:
image

Even on VSCode it's unable to resolve that ../../libs/shim/urijs.js path.
image

I think I see the issue.

Can you confirm or share if the requests in Postman or in a folder?
If they are not could, you try to put them in a folder and see if that solves the issue?

I use the "seperate" parameters but I think it is linked to requests not being in a folder, which results in an incorrect "import" path.

image

Should I add a folder? Or its already in a folder?
SMS Service Intenal --exported--> internal.json

After I add a folder in postman and put the request there, and execute the same command. The structure changes like this Request/OTP
image

@CMathgician

Thanks for providing the info to reproduce the issue.
I'm going to reopen the issue and will try to fix it when I have some free time at hands.

The bug is linked to requests not being in folders, while the convertor was expecting it in a folder.

@CMathgician The relative path issue is resolved and it will be part of the upcoming postman-to-k6 release.

Thanks for taking the time to report the issue.

Thank you @thim81

hi @CMathgician, The latest postman-to-k6 version (1.8.5) contains this enhancement.