gjergjsheldija / xk6-mllp

Simple MLLP sender for K6
MIT License
1 stars 4 forks source link

Object not found #14

Closed pirods closed 3 months ago

pirods commented 5 months ago

When trying to execute your example, the script fails when instantiating the mllp Client:

/build # ./k6 version
k6 v0.47.0 (go1.20.13, linux/amd64)
Extensions:
  github.com/gjergjsheldija/xk6-mllp (devel), k6/x/mllp [js]
/build # cat test.js 
import mllp from 'k6/x/mllp';

const client = new mllp.Client({
    host: '127.0.0.1',
    port: '5000'
});

export default function () {
    client.send('./sample.hl7');
}
/build # ./k6 run test.js 

          /\      |‾‾| /‾‾/   /‾‾/   
     /\  /  \     |  |/  /   /  /    
    /  \/    \    |     (   /   ‾‾\  
   /          \   |  |\  \ |  (‾)  | 
  / __________ \  |__| \__\ \_____/ .io

ERRO[0000] TypeError: Value is not an object: undefined
        at file:///build/test.js:3:15(32)  hint="script exception"

I've tried both using your docker image and installing manually as explained in the README

gjergjsheldija commented 3 months ago

hi @pirods

sorry for the late reply. sadly I cannot reproduce the error locally with go v1.20 and v1.21. what is the outcome of ./k6 version ?

pirods commented 3 months ago

Honestly, at this point I don't know what I was doing at the time. I tried again both with docker and building the image locally and everything works as expected. I apologise :)

gjergjsheldija commented 3 months ago

the important thing is that it's working :)