-
I made a reactive list with an object containing a Date, but get the error message TypeError: Method Date.prototype.toISOString called on incompatible receiver [object Object] when trying to print it, because Here's an example, just printing to console - const { div } = van.tags
const items = vanX.reactive([{ now: new Date() }])
van.add(
document.body,
// TypeError: Method Date.prototype.toISOString called
// on incompatible receiver [object Object]
vanX.list(div(), items,
v => console.log(v.val.now.toISOString())),
// Proxy(Date) {Symbol(): Array(0), Symbol(): {…}}
vanX.list(div(), items,
v => console.log(v.val.now)),
// Proxy(Object) {now: {…}, Symbol(): Array(0), Symbol(): {…}}
vanX.list(div(), items,
v => console.log(vanX.raw(v.val))),
// undefined
vanX.list(div(), items,
v => console.log(v.val.now.val)),
// Proxy(Object) {now: {…}, Symbol(): Array(0), Symbol(): {…}}
vanX.list(div(), items,
v => console.log(v.val)),
// {rawVal: Proxy(Object), _oldVal: Proxy(Object), _bindings: Array(0), _listeners: Array(0)}
vanX.list(div(), items,
v => console.log(v)),
) Chatting with Gemini didn't help! Thank you - |
Beta Was this translation helpful? Give feedback.
Answered by
Tao-VanJS
May 22, 2025
Replies: 1 comment 1 reply
-
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
bburns
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note the caveat mentioned in the VanJS website: