You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tried in both background index.ts and content scripts, both have the issue.
My code:
import * as pdfjsLib from 'pdfjs-dist';
pdfjsLib.GlobalWorkerOptions.workerSrc = `//mozilla.github.io/pdf.js/build/pdf.worker.js`;
const pdf = await pdfjsLib.getDocument(msg.pdfUrl).promise;
const numPages = pdf.numPages;
let fullText = '';
for (let pageNumber = 1; pageNumber <= numPages; pageNumber++) {
const page = await pdf.getPage(pageNumber);
const textContent = await page.getTextContent();
textContent.items.forEach(item => {
fullText += item.str;
});
}
When the extension is compiled and loaded in Chrome, Chrome pops an alert saying:
Failed to load extension
File
~/Products/GPTPlugin/gpt-plugin/build/chrome-mv3-dev
Error
Cannot load extension with file or directory name _empty.c3437ec2.js. Filenames starting with "_" are reserved for use by the system.
Could not load manifest.
Version
Latest
What OS are you seeing the problem on?
MacOSX
What browsers are you seeing the problem on?
Chrome
Relevant log output
No log because the error occurs when the extension is loaded
I solved error by using
import { pdfjs } from "react-pdf"
pdfjs.GlobalWorkerOptions.workerSrc = //cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.js
instead of
import * as pdfjs from 'pdfjs-dist'
What happened?
Tried in both background index.ts and content scripts, both have the issue.
My code:
When the extension is compiled and loaded in Chrome, Chrome pops an alert saying:
Version
Latest
What OS are you seeing the problem on?
MacOSX
What browsers are you seeing the problem on?
Chrome
Relevant log output
(OPTIONAL) Contribution
Code of Conduct
The text was updated successfully, but these errors were encountered: