pmalhaire / xk6-mqtt

k6 mqtt extension
Apache License 2.0
47 stars 37 forks source link

TypeError: Value is not an object: undefined #14

Closed samerhijazi closed 1 year ago

samerhijazi commented 1 year ago

Hi, i'am trying the example code from: https://github.com/pmalhaire/xk6-mqtt/blob/main/examples/test_ssl.js

and I am getting the error "TypeError: Value is not an object: undefined" from the line 49 "let publisher = new mqtt.Client("

Thanks for your help Samer

pmalhaire commented 1 year ago

Can you provide the config you are using and thé command you use ?

gajownikp commented 1 year ago

Hi, i'am trying the example code from: https://github.com/pmalhaire/xk6-mqtt/blob/main/examples/test_ssl.js

and I am getting the error "TypeError: Value is not an object: undefined" from the line 49 "let publisher = new mqtt.Client("

Thanks for your help Samer

Hello,

I have same issue run it with command: ./k6 run --vus 50 --duration 10s examples/test_ssl.js

samerhijazi commented 1 year ago

Hallo, I use the example file, just changed the cert location. Here are the commands:

$ ./k6 version k6 v0.38.0 ((devel), go1.19.3, darwin/arm64)

$ ./k6 run test_ssl.js .. ERRO[0000] TypeError: Value is not an object: undefined at file:///Users/samer/test_ssl.js:49:16(101) hint="script exception"

gajownikp commented 1 year ago

@samerhijazi are you using this command to build binary xk6 build --with github.com/pmalhaire/xk6-mqtt@latest

samerhijazi commented 1 year ago

@gajownikp : yes as described in the instructions.

gajownikp commented 1 year ago

@samerhijazi Binary is created with tag 0.38 (latest one) try this (as workaround): xk6 build --with github.com/pmalhaire/xk6-mqtt@f9d21adf It works for my mac and GHA @pmalhaire please add new tag to repo

samerhijazi commented 1 year ago

Workaround works. Thanks @gajownikp Thanks @pmalhaire for the code.

pmalhaire commented 1 year ago

I'll add a New tag then

pmalhaire commented 1 year ago

New tag added