The moduleSpecifier "util" has no scheme

I am getting this warning twice when running k6 tests. grpc how to I resolve it?

WARN[0001] The moduleSpecifier “util” has no scheme but we will try to resolve it as remote module. This will be deprecated in the future and all remote modules will need to explicitly use “https” as scheme.

Hi @Jamie

Welcome to the forum :wave:

Can you share your (sanitized) script? It’s usually easier to spot what is going on if you can share it.

This warning message is usually displayed when the module specifier for the util module does not specify a scheme (e.g., http, https, etc.), and k6 is attempting to resolve it as a remote module.

If that is the case, you can specify the https scheme for the util module in your k6 test script. For example:

import { check } from 'https://jslib.k6.io/util/index.js';

I hope this helps!

Hi

Thanks for your response. You have nailed where the issue is. I have added https but it still is throwing the errors:

import { expect } from “https://cdnjs.cloudflare.com/ajax/libs/chai/4.3.7/chai.min.js”;

I guess expect could be importing libraries that do no have https/http defined

thanks for your help. I will isolate this script on its own. until the issue is resolved.

1 Like

Hi

I found a solution, I changed the library above for:
import { describe, expect } from ‘https://jslib.k6.io/k6chaijs/4.3.4.2/index.js’;

There is a whole k6 page dedicated to it:

I am new to k6 and the documentation is very good. looking forward to seeing if in the future the product will support bio directional GRPC servcies.

Thanks again and seasonal greetings

Jamie

2 Likes

Awesome @Jamie, thanks for the feedback. I do like the docs as well :grinning:

Enjoy the holiday season and happy testing!