Skip to content

Enable Umami analytics generate error in offscreen #2594

Description

@PawelGawlikDev

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

Mac os,

Used Package Manager

pnpm

Validations

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions