I have the same error, also hapenning only when I use maultiple VUs. Here is my scenario:
{
executor: 'constant-vus',
vus: 10,
duration: `4.5m`,
gracefulStop: '30s',
options: {
browser: {
type: 'chromium',
},
}
}
Here is the error stack:
ERRO[0160] panic: runtime error: invalid memory address or nil pointer dereference
goroutine 182 [running]:
runtime/debug.Stack()
csTimeSeruntime/debug/stack.go:24 +0x64
go.k6.io/k6/js/common.RunWithPanicCatching.func1()
csExplaigo.k6.io/k6/js/common/util.go:82 +0x190
panic({0x101dc1960?, 0x102dc8c70?})
runtime/panic.go:914 +0x218
github.com/dop251/goja.(*Runtime).runWrapped.func1()
github.com/dop251/goja@v0.0.0-20231027120936-b396bb4c349d/runtime.go:2442 +0x168
panic({0x101dc1960?, 0x102dc8c70?})
runtime/panic.go:914 +0x218
github.com/dop251/goja.(*vm).handleThrow(0x14002437320, {0x101dc1960, 0x102dc8c70})
github.com/dop251/goja@v0.0.0-20231027120936-b396bb4c349d/vm.go:788 +0x3e0
github.com/dop251/goja.(*vm).try.func1()
github.com/dop251/goja@v0.0.0-20231027120936-b396bb4c349d/vm.go:807 +0x48
panic({0x101dc1960?, 0x102dc8c70?})
runtime/panic.go:914 +0x218
github.com/dop251/goja.(*vm).handleThrow(0x14002437320, {0x101dc1960, 0x102dc8c70})
github.com/dop251/goja@v0.0.0-20231027120936-b396bb4c349d/vm.go:788 +0x3e0
github.com/dop251/goja.(*vm).runTryInner.func1()
github.com/dop251/goja@v0.0.0-20231027120936-b396bb4c349d/vm.go:830 +0x48
panic({0x101dc1960?, 0x102dc8c70?})
runtime/panic.go:914 +0x218
github.com/grafana/xk6-browser/common.(*screenshotter).fullPageSize(0x140050186e0, 0x1400231e9c0)
github.com/grafana/xk6-browser@v1.3.0/common/screenshotter.go:105 +0xfc
github.com/grafana/xk6-browser/common.(*screenshotter).screenshotPage(0x14005018738?, 0x1400231e9c0, 0x14005018738)
github.com/grafana/xk6-browser@v1.3.0/common/screenshotter.go:324 +0x2b8
github.com/grafana/xk6-browser/common.(*Page).Screenshot(0x1400231e9c0, {0x1020289b0, 0x140023e6ea0})
github.com/grafana/xk6-browser@v1.3.0/common/page.go:1119 +0x29c
reflect.Value.call({0x101d62060?, 0x14000c872d0?, 0x14a3bb650?}, {0x1018afa59, 0x4}, {0x14000f1b080, 0x1, 0x0?})
reflect/value.go:596 +0x994
reflect.Value.Call({0x101d62060?, 0x14000c872d0?, 0x140023e6ea0?}, {0x14000f1b080?, 0x140021779d0?, 0x10095f394?})
reflect/value.go:380 +0x94
github.com/dop251/goja.(*Runtime).newWrappedFunc.(*Runtime).wrapReflectFunc.func1({{0x1020289b0, 0x140029b1080}, {0x140004949a0, 0x1, 0x1a}})
github.com/dop251/goja@v0.0.0-20231027120936-b396bb4c349d/runtime.go:1982 +0x2cc
github.com/dop251/goja.(*nativeFuncObject).vmCall(0x140003829c0, 0x14002437320, 0x1)
github.com/dop251/goja@v0.0.0-20231027120936-b396bb4c349d/func.go:563 +0x16c
github.com/dop251/goja.call.exec(0x2437320?, 0x14002437320)
github.com/dop251/goja@v0.0.0-20231027120936-b396bb4c349d/vm.go:3366 +0x74
github.com/dop251/goja.(*vm).run(0x14002437320)
github.com/dop251/goja@v0.0.0-20231027120936-b396bb4c349d/vm.go:582 +0x6c
github.com/dop251/goja.(*vm).runTryInner(0x14000ca73f0?)
github.com/dop251/goja@v0.0.0-20231027120936-b396bb4c349d/vm.go:834 +0x58
github.com/dop251/goja.(*generator).step(0x14000c248c0)
github.com/dop251/goja@v0.0.0-20231027120936-b396bb4c349d/func.go:762 +0x30
github.com/dop251/goja.(*generator).nextThrow(0x14000c248c0, {0x101fa79e0, 0x14000b03cb0})
github.com/dop251/goja@v0.0.0-20231027120936-b396bb4c349d/func.go:815 +0x1f8
github.com/dop251/goja.(*asyncRunner).onRejected(0x14000c248c0, {{0x102028dd8, 0x102e27b00}, {0x14000969380, 0x1, 0x1}})
github.com/dop251/goja@v0.0.0-20231027120936-b396bb4c349d/func.go:697 +0xe0
github.com/dop251/goja.(*Runtime).callJobCallback(0x0?, 0x14a01c350?, {0x102028dd8?, 0x102e27b00?}, {0x14000969380?, 0x10015c800?, 0x14003efd588?})
github.com/dop251/goja@v0.0.0-20231027120936-b396bb4c349d/runtime.go:2878 +0x64
github.com/dop251/goja.(*Promise).reject.(*Runtime).triggerPromiseReactions.(*Runtime).newPromiseReactionJob.func1.1()
github.com/dop251/goja@v0.0.0-20231027120936-b396bb4c349d/builtin_promise.go:213 +0xac
github.com/dop251/goja.(*vm).try(0x14002437320, 0x14003efd680)
github.com/dop251/goja@v0.0.0-20231027120936-b396bb4c349d/vm.go:811 +0x1e0
github.com/dop251/goja.(*Promise).reject.(*Runtime).triggerPromiseReactions.(*Runtime).newPromiseReactionJob.func1()
github.com/dop251/goja@v0.0.0-20231027120936-b396bb4c349d/builtin_promise.go:212 +0xc0
github.com/dop251/goja.(*Runtime).leave(0x14000eaa800)
github.com/dop251/goja@v0.0.0-20231027120936-b396bb4c349d/runtime.go:2751 +0xe0
github.com/dop251/goja.(*Runtime).runWrapped(0x14000eaa800, 0x103445878?)
github.com/dop251/goja@v0.0.0-20231027120936-b396bb4c349d/runtime.go:2451 +0xf0
github.com/dop251/goja.AssertFunction.func1({0x0?, 0x0?}, {0x14000969360?, 0x0?, 0x0?})
github.com/dop251/goja@v0.0.0-20231027120936-b396bb4c349d/runtime.go:2401 +0x78
github.com/dop251/goja.(*Runtime).wrapPromiseReaction.func1({0x101dcc800?, 0x140010deec0?})
github.com/dop251/goja@v0.0.0-20231027120936-b396bb4c349d/builtin_promise.go:601 +0xa8
github.com/grafana/xk6-browser/k6ext.promise.func1.1()
github.com/grafana/xk6-browser@v1.3.0/k6ext/promise.go:44 +0x4c
go.k6.io/k6/js/eventloop.(*EventLoop).Start(0x14002d66500, 0x14001084f00)
go.k6.io/k6/js/eventloop/eventloop.go:177 +0x16c
go.k6.io/k6/js.(*VU).runFn.func2()
go.k6.io/k6/js/runner.go:865 +0xe0
go.k6.io/k6/js/common.RunWithPanicCatching({0x10202d008?, 0x14000352800?}, 0x101d368a0?, 0x140027898c0?)
go.k6.io/k6/js/common/util.go:86 +0x74
go.k6.io/k6/js.(*VU).runFn(0x14001764aa0, {0x102019c68, 0x140026c5a90}, 0x60?, 0x14001d82798, 0x14002218270, {0x140003379c0, 0x1, 0x1})
go.k6.io/k6/js/runner.go:864 +0x1d8
go.k6.io/k6/js.(*ActiveVU).RunOnce(0x14000b5a000)
go.k6.io/k6/js/runner.go:797 +0x3d4
go.k6.io/k6/lib/executor.ConstantVUs.Run.getIterationRunner.func7({0x102019c30, 0x14000f16180}, {0x102007818?, 0x14000b5a000?})
go.k6.io/k6/lib/executor/helpers.go:81 +0x44
go.k6.io/k6/lib/executor.ConstantVUs.Run.func5({0x102013098, 0x14001764aa0})
go.k6.io/k6/lib/executor/constant_vus.go:193 +0x284
created by go.k6.io/k6/lib/executor.ConstantVUs.Run in goroutine 165
go.k6.io/k6/lib/executor/constant_vus.go:204 +0x708
Goja stack:
I’m using MacOS Ventura 13.3.1 Apple Mi Pro Chip 16GM Memory k6 v0.49.0 (go1.21.6, darwin/arm64)