Skip to content

xhr: panic: attempt to unwrap error: NativeTypeUnhandled #456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dur3x opened this issue Mar 4, 2025 · 1 comment
Open

xhr: panic: attempt to unwrap error: NativeTypeUnhandled #456

dur3x opened this issue Mar 4, 2025 · 1 comment
Assignees
Labels
bug Something isn't working DOM API

Comments

@dur3x
Copy link

dur3x commented Mar 4, 2025

% ./lightpanda fetch --dump "https://ihpo.be/en/washer-dryers"
info(browser): GET https://ihpo.be/en/washer-dryers 200
info(browser): fetch https://cdn.jsdelivr.net/npm/@alma/[email protected]/dist/widgets.umd.js: http.Status.ok
info(browser): fetch https://ihpo.be/build/assets/app-5421f13c.js: http.Status.ok
thread 24157823 panic: attempt to unwrap error
zsh: abort ./lightpanda fetch --dump "https://ihpo.be/en/washer-dryers"

@krichprollsch krichprollsch self-assigned this Mar 5, 2025
@krichprollsch krichprollsch added bug Something isn't working DOM API labels Mar 5, 2025
@krichprollsch
Copy link
Member

Hello @dur3x,
Thanks for the issue.

I re-run your query in dev env.
I seems something is wrong with xhr, we don't handle URLSearchParams correctly in this case.

$ zig build run --  fetch --dump "https://ihpo.be/en/washer-dryers"
debug(cli): Fetch mode: url https://ihpo.be/en/washer-dryers, dump true
debug(browser): start js env
debug(browser): setup global env
debug(polyfill): load polyfill-fetch: undefined
debug(browser): inspector context created
debug: Inspector contextCreated called
debug(browser): starting GET https://ihpo.be/en/washer-dryers
info(browser): GET https://ihpo.be/en/washer-dryers 200
debug(browser): http.Version.HTTP/1.1 200 OK
debug(browser): header content-type: text/html; charset=UTF-8
debug(browser): parse html with charset UTF-8
debug: Inspector contextCreated called
debug(browser): eval script inline: production
debug(browser): eval script inline: undefined
debug(browser): starting GET https://cdn.jsdelivr.net/npm/@alma/[email protected]/dist/widgets.umd.js
debug(browser): starting fetch https://cdn.jsdelivr.net/npm/@alma/[email protected]/dist/widgets.umd.js
info(browser): fetch https://cdn.jsdelivr.net/npm/@alma/[email protected]/dist/widgets.umd.js: http.Status.ok
debug(browser): eval script https://cdn.jsdelivr.net/npm/@alma/[email protected]/dist/widgets.umd.js: true
debug(browser): starting GET https://ihpo.be/build/assets/app-5421f13c.js
debug(browser): starting fetch https://ihpo.be/build/assets/app-5421f13c.js
info(browser): fetch https://ihpo.be/build/assets/app-5421f13c.js: http.Status.ok
debug(xhr): open url (https://o4508121418760192.ingest.de.sentry.io/api/4508125637902416/envelope/?[object URLSearchParams])
thread 144304 panic: attempt to unwrap error: NativeTypeUnhandled
/home/pierre/wrk/browser/vendor/zig-js-runtime/src/engines/v8/types_primitives.zig:60:17: 0x206515f in nativeToJS__anon_32589 (lightpanda)
        else => return error.NativeTypeUnhandled,
                ^
/home/pierre/wrk/browser/vendor/zig-js-runtime/src/engines/v8/generate.zig:708:13: 0x2065221 in setNativeType__anon_32588 (lightpanda)
    ) catch unreachable; // NOTE: should not happen has types have been checked at reflect
            ^
/home/pierre/wrk/browser/vendor/zig-js-runtime/src/engines/v8/generate.zig:626:29: 0x2065332 in setNativeType__anon_32587 (lightpanda)
        return setNativeType(
                            ^
/home/pierre/wrk/browser/vendor/zig-js-runtime/src/engines/v8/generate.zig:959:37: 0x1e32507 in callFunc__anon_30209 (lightpanda)
        const js_val = setNativeType(
                                    ^
/home/pierre/wrk/browser/vendor/zig-js-runtime/src/engines/v8/generate.zig:1032:21: 0x1d3c10e in getter (lightpanda)
            callFunc(
                    ^
../../../../v8/src/api/api-arguments-inl.h:201:3: 0x30b4c80 in BasicCallNamedGetterCallback (../../../../v8/src/objects/objects.cc)
../../../../v8/src/api/api-arguments-inl.h:315:10: 0x308a3e7 in CallAccessorGetter (../../../../v8/src/objects/objects.cc)
../../../../v8/src/objects/objects.cc:1442:34: 0x3088989 in GetPropertyWithAccessor (../../../../v8/src/objects/objects.cc)
../../../../v8/src/objects/objects.cc:1185:16: 0x30874b3 in GetProperty (../../../../v8/src/objects/objects.cc)
../../../../v8/src/runtime/runtime-object.cc:42:32: 0x45bc037 in GetObjectProperty (../../../../v8/src/runtime/runtime-object.cc)
../../../../v8/src/runtime/runtime-object.cc:870:3: 0x45c7ca1 in __RT_impl_Runtime_GetProperty (../../../../v8/src/runtime/runtime-object.cc)
../../../../v8/src/runtime/runtime-object.cc:769:1: 0x45c7067 in Runtime_GetProperty (../../../../v8/src/runtime/runtime-object.cc)

@krichprollsch krichprollsch changed the title panic: attempt to unwrap error xhr: panic: attempt to unwrap error: NativeTypeUnhandled Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working DOM API
Projects
None yet
Development

No branches or pull requests

2 participants