Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Why is this object a Proxy only when the page field is 1?

$
0
0

Steps to reproduce:

  1. Open the reproduction

  2. Open the browser console

  3. When the project starts it will errors with:

    Uncaught (in promise) DOMException: Failed to execute 'put' on 'IDBObjectStore': #<Object> could not be cloned.

    image

    This is happening because IndexedDB cannot serialize and persist a Proxy object which is pagination in this case.

    But...

  4. If you click on "Next" button the pagination changes from {"page":1,"size":5} to {"page":2,"size":5} and IndexedDB persists the object with no issues!

  5. Even stranger: if you click on the "Previous" button it changes from page:2 to page:1 and the error is here again!

image

Why the first page is a Proxy object and the following pages not?


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>