AnnotationLayer error and not sure why that is
See original GitHub issueBefore you start - checklist
- I followed instructions in documentation written for my React-PDF version
- I have checked if this bug is not already reported
- I have checked if an issue is not listed in Known issues
- If I have a problem with PDF rendering, I checked if my PDF renders properly in Mozilla Firefox
React-PDF 5.2
Trying to display some Base64 PDF as a document, but getting this instead:
./node_modules/react-pdf/dist/esm/Page/AnnotationLayer.js 195:8-29
"export 'AnnotationLayer' (imported as 'pdfjs') was not found in 'pdfjs-dist'
followed by numerous other errors…
ERROR in ./node_modules/react-pdf/dist/esm/eventBus.js 2:19-27
15:26:11 webpack.1 | "export 'EventBus' was not found in 'pdfjs-dist/lib/web/ui_utils'
ERROR in ./node_modules/react-pdf/dist/esm/entry.webpack.js 14:2-27
15:26:11 webpack.1 | "export 'GlobalWorkerOptions' (imported as 'pdfjs') was not found in 'pdfjs-dist'
My setup code in my JSX file is:
import { Document } from 'react-pdf/dist/esm/entry.webpack';
import 'react-pdf/dist/Page/AnnotationLayer.css';
My Component looks like this:
<Document file={data:application/pdf;base64,${data}
}>
What am I doing wrong to earn that message about AnnotationLayer and all the other problems?
My package.json shows yarn installed the package:
"react-pdf": "^5.2.0",
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:14 (2 by maintainers)
Top Results From Across the Web
Developers - AnnotationLayer error and not sure why that is -
Coming soon: A brand new website interface for an even better experience!
Read more >Problem consuming Annotation Layer: "invalid response"
I'm trying to learn how to consume an "Annotation Layer" from the UWP ... this gives an error "invalid response" on the last...
Read more >Annotation layer's feature class does not have a symbol stored ...
You are using a geodatabase annotation feature class that does not reference a symbol collection. This can potentially affect drawing performance because each ......
Read more >Using annotation layer inside group layer without getting error ...
Draw something (e.g. freehand) - This does not work! You will get the error message "error adding element". You will now not be...
Read more >Error message: Overflow in AnnotationLayer.Form_Load at line 146 ...
Since Presenter 09 isn't supported with Office 2016, I can't say for certain what is causing that error. If you're able to update...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@resistorsoftware you are not alone. I am also getting this error, but I don’t even import AnnotationLayer.css anywhere. Local development works but it breaks build.
Edit: it happens if I use “craco” to override CRA config.
So no one else ever gets this error. I am not amused. How do I run into these kinds of issues… yay!! I figured out how to render a PDF without this node package. In the meantime… was hoping anyone had some advice about what might be causing this package to die this way.
Just double-checked and even when I think it could be due to something else, nope… still puzzled. Won’t compile at all.
ERROR in ./node_modules/react-pdf/dist/esm/Page/AnnotationLayer.js 195:8-29 09:35:23 webpack.1 | "export ‘AnnotationLayer’ (imported as ‘pdfjs’) was not found in ‘pdfjs-dist’