ERRO[0000] unknown module: k6/x/browser

Hi everyone! I’m new to k6. I was exited to try new feature with browser automation.

I did all the necessary in the article:

By the way you should replace
go install github. com/grafana/xk6/cmd/xk6@latest (didn’t work for me in Win10)
with
go install go.k6.io/xk6/cmd/xk6@latest (this worked)

Below my screen showing the installation was successful:

But then I tried the very same script from your article above and I get this error:
on the screen below CMD output

What did I do wrong?

2 Likes

Hi Alexbirvik,

Thanks for reporting this issue. I noticed that you discovered the issue on Github and fixed the problem.

Thanks for notifying us to update the README.

@inanc But please wait, that is not the problem I reported.
My problem is error: ERRO[0000] unknown module: k6/x/browser

This is not solved. The first issue was just to notify you about readme, yes, but the real issue is an ERROR I get lanching my script.

@inanc Please look at my screenshot I get this error all the time regardless all the installation process was successful:

Hi Alex,

Sorry, I thought it was resolved. Did you follow the steps in our readme?

First install the xk6 and xk6-browser extension:

go install go.k6.io/xk6/cmd/xk6@latest
xk6 build --output xk6-browser --with github.com/grafana/xk6-browser

Then run it using the xk6-browser executable:

./xk6-browser run test-xk6.js

Please let me know how it goes.

1 Like

HI @inanc Thanks for the fast reply!

Please take a look: I tried your suggestion and command doesnt work for me in VScode - on the screen right side

Hi Alex,

Sure. Could you try the following command:

.\xk6-browser.exe run test-xk6.js

Or, without .exe:

.\xk6-browser run test-xk6.js

@inanc no, I’ve tried all the possible combinations…

I use Win 10 by the way. Maybe I need to put some changes into PATH manually?

Hmm, weird. Can you validate that there is an xk6-browser binary in the same folder that you’re running the example?

You probably have k6.exe in the folder, so please try:

.\k6.exe run test-xk6.js

Or, without .exe:

.\k6 run test-xk6.js

@inanc Thank you! Now script is working.
But I put both
k6.exe and xk6-browser in the current directory (where my test-xk6.js located).

It is unclear how to set it up from the articles and readme.

I (and probably the most of community) will appreciate if you will provide a comprehensive tutorial how to set up xk6-browser.

Thanks again!

2 Likes

Hi Alex,

We will update the installation instructions accordingly, especially for Windows.

Thank you!

1 Like