ERRO[0000] unknown module: k6/experimental/websockets


Please help me, how can I overcome this error

Hi @lampln2011

Welcome to the community forum :wave:

From the screenshot the import seems correct, even though the error says unknown module. Same import as in the examples:

import { WebSocket } from 'k6/experimental/websockets';

It usually helps if you can share the full script in text format, as we can copy/paste the script and detect if there is something amiss.

That said, the experimental module was introduced in version 0.40.0: Release v0.40.0 · grafana/k6 · GitHub. Can you check your version? k6 version to double-check it’s not an older version?

If that’s not the issue, as mentioned, please share the script in text format so we can more easily have a look and reproduce it on our lab.

Cheers!

1 Like

Hi

I have upgraded from k6 v0.38.3 (2022-05-18T07:29:13+0000/b94dbe3, go1.17.9, windows/amd64)

to k6 v0.40.0 (2022-09-08T09:06:02+0000/v0.39.0-92-gdcbe2f9c, go1.18.6, windows/amd64) then the issue disappears,

Thanks

1 Like