-
Notifications
You must be signed in to change notification settings - Fork 43
panic: interface conversion: interface is nil, not goja.Value #417
Comments
A temporary fix seems easy, but the error points out a race condition issue. xk6-browser/common/element_handle.go Line 660 in eb13672
- value := result.(goja.Value)
+ value, ok := result.(goja.Value)
+ if !ok {
+ ...
+ } |
Yeah, definitely caused by a race condition, but we shouldn't crash because of it, so always checking type assertions is the safe thing to do. @inancgumus If you're planning to work on this, could you also do that change in all other places we assume a |
This commit properly type asserts and removes nolint directives. There are new helpers to reduce code bloat and possible error messages refactoring work: + asGojaValue: returns a given value as a goja value or panics. + gojaValueToString: returns a given a value as string or panics. This commit also refactors tests to remove nolint directives. Fixes: #417
This commit properly type asserts and removes nolint directives. There are new helpers to reduce code bloat and possible error messages refactoring work: + asGojaValue: returns a given value as a goja value or panics. + gojaValueToString: returns a given a value as string or panics. This commit also refactors tests to remove nolint directives. Fixes: #417
@sniku, before the fix, we were seeing the following errors:
After the fix, I rerun the script you shared, and we no longer get any of these errors. However, we still get the usual race condition errors as follows:
The error above is not about this issue; we'll address race condition issues in #428 and #427. |
This commit properly type asserts and removes nolint directives. There are new helpers to reduce code bloat and possible error messages refactoring work: + asGojaValue: returns a given value as a goja value or panics. + gojaValueToString: returns a given a value as string or panics. This commit also refactors tests to remove nolint directives. Fixes: #417
xk6-browser panics with the attached script.
version: latest main eb13672
The panic is reproducible on my machine. It happened 4 times in the row.
panic-2022-06-27_16.32.27.mp4
The text was updated successfully, but these errors were encountered: