Skip to content

await analytics.track() produces TS80007 because Analytics interface returns void instead of Promise<void> #2408

@muhammedaksam

Description

@muhammedaksam

Describe the bug

Using await analytics.track(...) (and page, identify, setEnabled) produces TS80007: 'await' has no effect on the type of this expression.
The Analytics interface in @wxt-dev/analytics declares all methods as returning void, even though the background implementation is async (returns Promise<void>). The frontend implementation returns void. Since Promise<void> is assignable to void, there's no implementation error — but users calling await analytics.track() see TS80007 because the declared return type is void.

Reproduction

  1. Create a WXT project with @wxt-dev/analytics configured
  2. In any entrypoint (popup, options, content script, etc.), call await analytics.track('my_event')
  3. Observe TS80007 in the editor or type checker

Steps to reproduce

  1. npm create wxt@latest -- wxt-analytics-test
  2. cd wxt-analytics-test
  3. npm i @wxt-dev/analytics
  4. Add analytics config to app.config.ts
  5. In an entrypoint: await analytics.track('test')
  6. npx tsc --noEmit

System Info

System:
    OS: Linux 7.0 Arch Linux
    CPU: (12) x64 Intel(R) Core(TM) i7-8086K CPU @ 4.00GHz
    Memory: 4.42 GB / 15.55 GB
    Container: Yes
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 24.11.1 - /home/xanela/.config/nvm/versions/node/v24.11.1/bin/node
    Yarn: 1.22.22 - /home/xanela/.config/nvm/versions/node/v24.11.1/bin/yarn
    npm: 11.6.2 - /home/xanela/.config/nvm/versions/node/v24.11.1/bin/npm
    pnpm: 10.25.0 - /home/xanela/.config/nvm/versions/node/v24.11.1/bin/pnpm
    bun: 1.3.3 - /home/xanela/.bun/bin/bun
    Deno: 2.8.0 - /usr/bin/deno
  npmPackages:
    @wxt-dev/analytics: ^0.5.4 => 0.5.4 
    wxt: ^0.20.26 => 0.20.26

Used Package Manager

pnpm

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending-triageSomeone (usually a maintainer) needs to look into this to see if it's a bug

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions