I get this error when I try to preprocess my data from the setup function in a k6 test: ERRO[0132] error marshaling setup() data to JSON: json: unsupported value: NaN
I do not know what this means, or where to find documentation about this.
If I print out the data, it looks like proper JSON and it contains zero NaN values.
I have to double-check and probably open an issue in our GitHub. However, some workaround is possible, like defaulting to any other value (including null):
export function setup() {
return {y: NaN || 0}
}
export default (data) => {
console.log(data)
}