Skip to content
New issue

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

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

Already on GitHub? # to your account

wxt/storage doesn't work for MV2 #1199

Closed
5 tasks done
aklinker1 opened this issue Nov 22, 2024 · 4 comments · Fixed by #1200
Closed
5 tasks done

wxt/storage doesn't work for MV2 #1199

aklinker1 opened this issue Nov 22, 2024 · 4 comments · Fixed by #1200
Labels
bug Something isn't working

Comments

@aklinker1
Copy link
Collaborator

Describe the bug

Because wxt/storage uses chrome, in MV2 it requires a callback parameter. However, that parameter is not passed, and it is assumed the storage returns a promise, like it does for MV3 or the browser object.

TypeError: can't access property "...", res is undefined

But since it expects a callback, it returns undefined instead of a promise and we get the error from above.

Reproduction

repro.zip

Steps to reproduce

pnpm dev:firefox

And open the background devtools

System Info

System:
    OS: macOS 14.2.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 1.36 GB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.20.3 - ~/.asdf/installs/nodejs/18.20.3/bin/node
    npm: 10.7.0 - ~/.asdf/plugins/nodejs/shims/npm
    pnpm: 9.13.0 - ~/.asdf/installs/nodejs/18.20.3/bin/pnpm
    bun: 1.1.27 - ~/.bunv/bin/bun
  Browsers:
    Chrome: 131.0.6778.86
    Safari: 17.2.1
  npmPackages:
    wxt: ^0.19.13 => 0.19.16

Used Package Manager

pnpm

Validations

@aklinker1 aklinker1 added pending-triage Someone (usually a maintainer) needs to look into this to see if it's a bug bug Something isn't working and removed pending-triage Someone (usually a maintainer) needs to look into this to see if it's a bug labels Nov 22, 2024
@aklinker1
Copy link
Collaborator Author

Released in https://github.com/wxt-dev/wxt/releases/tag/storage-v1.0.1

@avi12
Copy link
Contributor

avi12 commented Nov 22, 2024

Any estimate of when it'll be pushed to wxt?

@aklinker1
Copy link
Collaborator Author

It's a subdependency, so update it and you can already use it

@aklinker1
Copy link
Collaborator Author

# Might work?
pnpm upgrade @wxt-dev/storage

# But this is what I usually do to upgrade a subdependency
pnpm i @wxt-dev/storage@latest
pnpm rm @wxt-dev/storage
pnpm why @wxt-dev/storage

tomowang added a commit to tomowang/peek-preview that referenced this issue Nov 25, 2024
according to wxt-dev/wxt#1199, firefox storage api will raise error
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants