qwik
qwik copied to clipboard
<Link/> inside of <Resource/>: QWIK ERROR can't access property "href", thing is undefined
Qwik Version
0.13.3
Operating System (or Browser)
Mozilla Firefox Developer Edition for Arch Linux 107.0b9 (64bit)
Node Version (if applicable)
19.0.1
Which component is affected?
Qwik Runtime
Expected Behaviour
I expect Link to work.
Actual Behaviour
It doesn't work. Here is the error: https://pastebin.com/4z2g3uXF
Additional Information
interface Stuff {
href: string
}
export default component$(() => {
const endpoint = useEndpoint<Stuff>()
return <Resource value={endpoint} onResolved={(thing) => <Link href={thing.href}>Click me</Link>}/>
});
export const onGet: RequestHandler<Stuff> = () => {
return { href: "/hello-world" }
}
It works fine if the data passed through useEndpoint
is a primitive (like string
or number
), if it is an object - everything explodes.
Reproducer: https://github.com/boohba/qwik-weird-resource-bug-reproducer
does it work if you add an onPending
handler that returns an empty tag?
does it work if you add an
onPending
handler that returns an empty tag?
Nope.
Looks related #1927
I'm running into this issue as well. Here is a reliable reproduction: https://stackblitz.com/edit/qwik-starter-cw9juq?file=src/routes/something/index.tsx
Steps:
- In the browser window to the right, click "Go to demo page" button
- Click "Go to homepage (triggers the bug)" button