With react-pdf-highlighter-extended v8.0.0, I could still import PdfLoader, PdfHighlighter into a javascript file as import { PdfHighlighter, PdfLoader} from "react-pdf-highlighter-extended";
After the update (update pdf.js), in v8.1.0 I now receive errors such as
Attempted import error: 'PdfLoader' is not exported from 'react-pdf-highlighter-extended' (imported as 'PdfLoader').
WARNING in ./node_modules/react-pdf-highlighter-extended/dist/esm/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/home/ubuntu/DocInsights/AML/services/frontend/node_modules/react-pdf-highlighter-extended/src/index.ts' file: Error: ENOENT: no such file or directory, open '/home/ubuntu/DocInsights/AML/services/frontend/node_modules/react-pdf-highlighter-extended/src/index.ts'
But then I get errors for components that imported in PdfHighlighter.js:
Module not found: Error: Can't resolve '../contexts/PdfHighlighterContext' in '/home/ubuntu/DocInsights/AML/services/frontend/node_modules/react-pdf-highlighter-extended/dist/esm/components'
Did you mean 'PdfHighlighterContext.js'?
BREAKING CHANGE: The request '../contexts/PdfHighlighterContext' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
WARNING in ./node_modules/react-pdf-highlighter-extended/dist/esm/components/PdfHighlighter.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/home/ubuntu/DocInsights/AML/services/frontend/node_modules/react-pdf-highlighter-extended/src/components/PdfHighlighter.tsx' file: Error: ENOENT: no such file or directory, open '/home/ubuntu/DocInsights/AML/services/frontend/node_modules/react-pdf-highlighter-extended/src/components/PdfHighlighter.tsx'
With react-pdf-highlighter-extended v8.0.0, I could still import PdfLoader, PdfHighlighter into a javascript file as
import { PdfHighlighter, PdfLoader} from "react-pdf-highlighter-extended";
After the update (update pdf.js), in v8.1.0 I now receive errors such as
I tried
But then I get errors for components that imported in PdfHighlighter.js:
Can someone help here?