plasmo: [BUG] Regression in bgsw on Firefox: Could not resolve bundle with id X

What happened?

I’m working with the following library in the background service worker of my extension: https://github.com/visheratin/web-ai

In Plasmo 0.74.2 everything worked fine on every browser (Firefox and Chromium-based), however after updating to Plasmo 0.75.2, I get an error on Firefox. It’s worth noting that everything still works fine on Chromium-based browsers, and if I try to use the library in the popup, the error disappears.

This is the minimal reproducible example of the background.ts that triggers the error in 0.75.2:

import { TextModel } from "@visheratin/web-ai";

async function initializeModel() {
    const result = await TextModel.create("mini-lm-v2-quant");
    console.log(result.elapsed);
}

initializeModel().catch(console.error);

I suspect this is yet another error related to Parcel.

Version

Latest

What OS are you seeing the problem on?

Linux

What browsers are you seeing the problem on?

Firefox

Relevant log output

23:22:07.590 Error: Could not resolve bundle with id 10tWj
    resolve1 moz-extension://f7479e89-e56d-4396-ae2b-78503febcb6d/background.a5c7ae1c.js:23108
    jDl6D moz-extension://f7479e89-e56d-4396-ae2b-78503febcb6d/background.a5c7ae1c.js:23037
    newRequire1 moz-extension://f7479e89-e56d-4396-ae2b-78503febcb6d/background.a5c7ae1c.js:29
    localRequire1 moz-extension://f7479e89-e56d-4396-ae2b-78503febcb6d/background.a5c7ae1c.js:34
    createSession1 moz-extension://f7479e89-e56d-4396-ae2b-78503febcb6d/background.a5c7ae1c.js:1072
    init moz-extension://f7479e89-e56d-4396-ae2b-78503febcb6d/background.a5c7ae1c.js:23781
    create moz-extension://f7479e89-e56d-4396-ae2b-78503febcb6d/background.a5c7ae1c.js:187
    initializeModel1 moz-extension://f7479e89-e56d-4396-ae2b-78503febcb6d/background.a5c7ae1c.js:93
    bkg1o moz-extension://f7479e89-e56d-4396-ae2b-78503febcb6d/background.a5c7ae1c.js:96
    newRequire1 moz-extension://f7479e89-e56d-4396-ae2b-78503febcb6d/background.a5c7ae1c.js:29
    localRequire1 moz-extension://f7479e89-e56d-4396-ae2b-78503febcb6d/background.a5c7ae1c.js:34
    frrV4 moz-extension://f7479e89-e56d-4396-ae2b-78503febcb6d/background.a5c7ae1c.js:83
    newRequire1 moz-extension://f7479e89-e56d-4396-ae2b-78503febcb6d/background.a5c7ae1c.js:29
    <anonymous> moz-extension://f7479e89-e56d-4396-ae2b-78503febcb6d/background.a5c7ae1c.js:66
    <anonymous> moz-extension://f7479e89-e56d-4396-ae2b-78503febcb6d/background.a5c7ae1c.js:80
    <anonymous> moz-extension://f7479e89-e56d-4396-ae2b-78503febcb6d/background.a5c7ae1c.js:51360

(OPTIONAL) Contribution

  • I would like to fix this BUG via a PR

Code of Conduct

  • I agree to follow this project’s Code of Conduct
  • I checked the current issues for duplicate problems.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17 (10 by maintainers)

Most upvoted comments

@GarciaLnk would you mind creating a sample repro repo that I can clone and play around with

Sure, here it is: https://github.com/GarciaLnk/sample-plasmo-bug