Bundled imports show up as null when running performance tests

I am currently working on integrating some client libraries from a project that uses the Fetch API as it’s HTTP Client when making requests. I am doing so as suggested, by using WebPack to bundle the packages together and then running the bundled file as the test file.

I’ve tried to include various implementations of the Fetch API but have been faced with an issue that when referencing the imported libraries with the Fetch API implementation, these references show up as either null or an empty object ({}).

Is there a particular supported node package with the fetch implementation that is known and used that I would be able to utilize ?

Please see repository below that reproduces the issue.

Hello. When using cross-fetch, you would not be using our built-in HTTP client (import http from 'k6/http') to send/receive requests, which is necessary if you want any kind of HTTP metrics to be available when you run your k6 script.

I think you would need to modify any calls to fetch with the equivalent using our HTTP client.