wxt-dev / wxt-dev/wxt

Cannot use WXT analytics in contexts without access to the browser.runtime APIs

Open
#1,847 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

pending-triage
Dominant language
TypeScript
Stars
10.5k
Forks
564
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

I am trying to integrate with ga via this package https://wxt.dev/analytics.html#wxt-analytics but no matter the zip or the dev, it got an error Uncaught Error: Cannot use WXT analytics in contexts without access to the browser.runtime APIs

I believe it is required by this module.
https://github.com/wxt-dev/wxt/blob/main/packages/analytics/modules/analytics/client.ts#L19

why does it have to require an id and if needed, how can I make sure the id are there?

Reproduction

simple follow the step of installing wxt-dev/analytics follow the guideline in https://wxt.dev/analytics.html#wxt-analytics

Steps to reproduce

No response

System Info
Chrome Version 139.0.7258.67 (Official Build) (arm64)
Used Package Manager

yarn

Validations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the WXT analytics documentation and packages/analytics/modules/analytics/client.ts at line 19. Reproduce the installation steps in a minimal extension using the reported Chrome version, then trace when browser.runtime is unavailable. Done should clarify the supported contexts and either document the required id/API conditions or resolve the reported failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.