Closed jessezhang91 closed 1 year ago
Start a new pull request in StackBlitz Codeflow.
We experience the same for a polymorphic component which is rendered dynamically inside of a campaign coming from our cms. If we add an ID outside, it works, but this can't be the solution.
@jessezhang91 good that you reproduced it.
I have a smaller repro:
import { component$, useComputed$, useSignal } from '@builder.io/qwik';
export default component$(() => {
const count = useSignal(123);
return (
<>
<button onClick$={() => (count.value += 1)}>Next</button>
{[count.value].map((o) => (
<Child key={o} value={o} />
))}
</>
);
});
export const Child = component$<{ value: number }>((props) => {
const foo = useComputed$(() => props.value);
return <div>{JSON.stringify(foo.value)}</div>;
});
Bisect yields https://github.com/BuilderIO/qwik/commit/4e032935ad57c0c0bd947e0ee506d5e5465a022f as culprit
"useComputed$" has been almost unusable since the end of August, in my opinion this is a critical bug, do you have the time to take a closer look? thank you very much.
let me have a look.
I am facing this issue. Is this a regression?
Internal server error: Code(27): Missing Object ID for captured object
@sarat1669 can you repro, preferably with https://qwik.dev/playground ?
Are you using noSerialize somewhere?
@sarat1669 have you found what the issue was? Getting the same error when SSR a specific route
In our code, the bug occurs when component A passes a prop to component B like this: <B someValue={chooseValue ? 1 : 2} /> and B uses someValue in useComputed.
Tried reproducing it in playground but didn't work. We are kinda stuck on version 1.5.6 of Qwik so maybe the bug has been fixed. Or more things that are happening in our code are coming together to produce the issue.
@sarat1669 if you have the same issue as us, moving chooseValue ? 1 : 2 to a useComputed solves the issue
EDIT: chooseValue has to be a prop of component A for this to crash
@gnemanja under console -> options you can choose the Qwik version of the repl
Here's a direct link to 1.5.6: https://qwik.dev/playground/#v=1.5.6&f=G000o4mG5EQDAA
@gnemanja under console -> options you can choose the Qwik version of the repl
Here's a direct link to 1.5.6: https://qwik.dev/playground/#v=1.5.6&f=G000o4mG5EQDAA
Thanks. It works, so it's not because of the qwik version... :(
Can you paste your attempt?
Ideally you'd compare the playground client modules output with your build, to see if the generated code is similar or not
Which component is affected?
Qwik Runtime
Describe the bug
I have an
<Icon>
component that modifies theprops
in auseComputed$
and spreads the result in an<i>
element. I expect this to work (it was working in v1.2.6) but I get a "QWIK ERROR Error: Code(27): Missing Object ID for captured object" instead.I'm not sure what the exact problem is but I've managed to replicate it in a simpler form that doesn't represent the actual real-world use case. From what I can tell the replication requires: (1) mapping over an array, (2) accessing the entire
props
object (i.e. not just a field of props) inuseComputed$
, and (3) mutating a value that gets put into the component'sprops
.Reproduction
https://stackblitz.com/edit/qwik-starter-t3qhf8?file=package.json,src%2Froutes%2Findex.tsx
Steps to reproduce
It immediately fails but if it doesn't I've noticed refreshing the page will cause the error to be thrown.
System Info
Additional Information
I believe this is related to https://github.com/BuilderIO/qwik/pull/4872. My code was working in v1.2.6.