(⎈ |prod5.us-east-1:default) ➜ pf-load-testing (master) ✗ npm run start <aws:tm-nonprod-Ops-Techops>
> email@example.com prestart /Users/alexandrelemieux/tm/tm1/pf-load-testing
> npm run build
> firstname.lastname@example.org build /Users/alexandrelemieux/tm/tm1/pf-load-testing
> npx tsc
> email@example.com start /Users/alexandrelemieux/tm/tm1/pf-load-testing
> k6 run build/index.js
/\ |‾‾| /‾‾/ /‾/
/\ / \ | |_/ / / /
/ \/ \ | | / ‾‾\
/ \ | |‾\ \ | (_) |
/ __________ \ |__| \__\ \___/ .io
WARN A url was resolved but it didn't have scheme. This will be deprecated in the future and all remote modules will need to explicitly use `https` as scheme url=//url-parse
ERRO GoError: The moduleSpecifier "url-parse" couldn't be retrieved from the resolved url "https://url-parse". Error : "Get https://url-parse: dial tcp: lookup url-parse: no such host"
Hi @piclem, k6 doesn’t support node module resolution or typescript and this is somewhat unlikely to change in both cases.
So you have two options:
You could get your dependencies from inside of node_modules or download them directly, and then import them with their full paths, possibly after browserfing some of them if they don’t run natevily in k6.
You can also try my proof of concept which uses webpack and babel to both do node modules resolution and combine all of the sources into a single file. You can definitely add it to automatically transpile typescript along the way. Please do share how it worked for you and if you automate the typescript transpiling I do take PRs
Yeah i try something like our repo. I’m using webpack to build a bundle for typescript + npm project for now it seems to work like a charm.