ITADN

Enable Umami analytics generate error in offscreen

#2594OpenPawelGawlikDev 创建于 17 天前
pending-triage
P
PawelGawlikDevcommented
### Describe the bug I'm provide umami analytics in my extension > app.config.ts ` export default defineAppConfig({ analytics: { enabled: storage.defineItem("local:enabled", { init: () => false }), userId: storage.defineItem("local:key", { init: () => crypto.randomUUID() as string | undefined }), userProperties: storage.defineItem("local:properties-key", { init: () => ({}) }), providers: [ umami({ apiUrl: umamiApiUrl, websiteId: umamiWebsiteId, domain: umamiDomain }) ] } }); ` And I have offscreen that run with my extension on browser run >background.ts ` (async () => { const contexts = await browser.runtime.getContexts({ contextTypes: [browser.runtime.ContextType.OFFSCREEN_DOCUMENT] }); if (!contexts.length) { await browser.offscreen.createDocument({ url: "/offscreen.html", reasons: ["DOM_SCRAPING"], justification: "Some reason" }); } await waitForOffscreenReady(); })(); ` With this I got error in offscreen Uncaught (in promise) Error: You must add the 'storage' permission to your manifest to use 'wxt/storage' even when I have storage in my manifest ### Reproduction Enable umami in app with described steps ### Steps to reproduce _No response_ ### System Info ```shell Mac os, ``` ### Used Package Manager pnpm ### Validations - [x] Read the [Contributing Guidelines](https://github.com/wxt-dev/wxt/blob/main/CONTRIBUTING.md). - [x] Read the [docs](https://wxt.dev/guide/installation.html). - [x] Check that there isn't [already an issue](https://github.com/wxt-dev/wxt/issues) that reports the same bug to avoid creating a duplicate. - [x] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/wxt-dev/wxt/discussions) or join our [Discord Chat Server](https://discord.gg/ZFsZqGery9). - [x] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
0 条评论