how to use mozilla/readability?

i want to use reaability in my project but it seem that cannot pack correctly
import { Readability } from "@mozilla/readability"

console.log("background script loaded")
chrome.runtime.onInstalled.addListener(() => {
  chrome.contextMenus.create({
    id: "sampleContextMenu",
    title: "Sample Context Menu",
    contexts: ["all"]
  })
})

chrome.contextMenus.onClicked.addListener((info, tab) => {
  if (info.menuItemId == "sampleContextMenu") {
    chrome.scripting.executeScript(
      {
        target: {
          tabId: tab.id
        },
        world: "MAIN",
        func: () => {
          const doc = window.document.body.innerHTML
          document.documentElement
          const r = new Readability(window.document)
          console.log(r)
          return {
            doc: doc
          }
        }
      },
      (res) => {
        const r = res[0].result
      }
    )

and will get this error
image.png
image.png
Was this page helpful?