Cannot use WXT analytics in contexts without access to the browser.runtime APIs
Nobody has claimed this yet.
- 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
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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