Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defaultStorage.clear() errors #1684

Closed
codingnuclei opened this issue May 31, 2021 · 0 comments · Fixed by #1685
Closed

defaultStorage.clear() errors #1684

codingnuclei opened this issue May 31, 2021 · 0 comments · Fixed by #1685
Labels
bug 🐛 Oh no! A bug or unintented behaviour.

Comments

@codingnuclei
Copy link

Using the .clear() method returned from makeDefaultStorage errors with:

global-error-handler.service.ts:13 Error: Uncaught (in promise): NotFoundError: Failed to execute 'objectStore' on 'IDBTransaction': The specified object store was not found. Error: Failed to execute 'objectStore' on 'IDBTransaction': The specified object store was not found.

urql version & exchanges:
@urql/core: 2.1.2
@urql/exchange-graphcache: 4.1.2

Culprit:

https://github.com/FormidableLabs/urql/blob/276762c030acb22b4138fcd8ca12f851fe04ef2c/exchanges/graphcache/src/default-storage/index.ts#L98-L108

database.transaction should be called with both storeNames:

const transaction = database.transaction( [METADATA_STORE_NAME, ENTRIES_STORE_NAME], 'readwrite' );

MDN

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Oh no! A bug or unintented behaviour.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant