grafana / xk6-faker

Random fake data generator for k6.
https://faker.x.k6.io
GNU Affero General Public License v3.0
59 stars 18 forks source link

Error running script using xk6-faker #2

Closed gabrielzc closed 1 year ago

gabrielzc commented 2 years ago

Hi!

I'm trying to execute a script using faker, but I'm receiving this message:

ERRO[0000] unknown module: k6/x/faker at reflect.methodValueCall (native) at file:///Users/gabrielzc/desktop/k6-script/node_modules/scenarios/usuarios.js:38:121(35) hint="script exception"

I've imported like the example:

import { Faker } from "k6/x/faker"

let f = new Faker(); console.log(f.name());

Can you help me?

Thanks!

Mabciyptyl commented 2 years ago

Hi @gabrielzc Make sure you use the k6 compiled by xk6 that in the same directory you build the extension in.

szkiba commented 1 year ago

Yes, you need custom k6 build with xk6-faker extension enabled.