You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Passing an object through a chain of server$ calls will make the object frozen giving an error:
Error: 'getOwnPropertyDescriptor' on proxy: trap returned descriptor for property 'XXX' that is incompatible with the existing property in the proxy target
Reproduction
Steps to reproduce
you can use this "standalone" component on qwik 1.12.0 to get the error displayed
import { component$, Resource, useResource$, useStore } from "@builder.io/qwik";
import { server$ } from "@builder.io/qwik-city";
const printHello = server$(async (hello: Hello) => {
// Returning immediately here will work, i.e:
// return hello.print + " world";
// But if we returning another server$ function, will cause an error:
// Error: 'getOwnPropertyDescriptor' on proxy: trap returned descriptor for property 'print' that is incompatible with the existing property in the proxy target
return await printHello2(hello);
});
const printHello2 = server$(async (hello: Hello) => hello.print + " world2");
export interface Hello {
print: string;
}
export default component$(() => {
const helloStore = useStore<Hello>({ print: "hello" });
const resource = useResource$(async () => {
return await printHello(helloStore);
// Instead of using helloStore, we can do this to workaround it:
// return await printHello({
// print: helloStore.print
// });
});
return (
<>
<Resource
value={resource}
onPending={() => <div>Loading...</div>}
onRejected={(error) => <div>Error: {error.message}</div>}
onResolved={(data) => <div>Data: {data}</div>}
/>
</>
);
});
at Function.isFrozen (<anonymous>)
at ./node_modules/@builder.io/qwik-city/lib/index.qwik.mjs:1521:55
at Array.forEach (<anonymous>)
at deepFreeze (./node_modules/@builder.io/qwik-city/lib/index.qwik.mjs:1519:35)
at serverQrl_rpc_FusI6N08iPY (./node_modules/@builder.io/qwik-city/lib/index.qwik.mjs:1551:48)
at ./node_modules/dist-dev/tsc-out/packages/qwik/dist-dev/tsc-out/packages/qwik/src/core/qrl/qrl-class.js:55:31
at invokeApply (./node_modules/dist-dev/tsc-out/packages/qwik/dist-dev/tsc-out/packages/qwik/src/core/use/use-core.js:66:26)
at invoke (./node_modules/dist-dev/tsc-out/packages/qwik/dist-dev/tsc-out/packages/qwik/src/core/use/use-core.js:58:24)
at ./node_modules/dist-dev/tsc-out/packages/qwik/dist-dev/tsc-out/packages/qwik/src/core/qrl/qrl-class.js:117:27
at maybeThen (./node_modules/dist-dev/tsc-out/packages/qwik/dist-dev/tsc-out/packages/qwik/src/core/util/promises.js:20
The text was updated successfully, but these errors were encountered:
Which component is affected?
Qwik Runtime
Describe the bug
Passing an object through a chain of server$ calls will make the object frozen giving an error:
Error: 'getOwnPropertyDescriptor' on proxy: trap returned descriptor for property 'XXX' that is incompatible with the existing property in the proxy target
Reproduction
Steps to reproduce
you can use this "standalone" component on qwik 1.12.0 to get the error displayed
System Info
Additional Information
Stack trace:
The text was updated successfully, but these errors were encountered: