Need help in integrating pdfjs-dist version 5.4.394 (Object.defineProperty called on non-object) #20434
Unanswered
aditya-padhi-kbl
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Team,
Thank-you to the community for this wonderful library.
Problem statement:-
I am trying to integrate pdfjs-dist with nextjs.
Module details:-
pdfjs-dist:- 5.4.394
Nextjs:- 15.5.6
React:- 18.3.1
Reactdom:- 18.3.1
Environment:-
Browser:- Chrome, Safari
OS:- MacOs
github URL:- https://github.com/aditya-padhi-kbl/pdfjsdist_v5.4.394_snip
CodeSandbox URL:- https://codesandbox.io/p/github/aditya-padhi-kbl/pdfjsdist_v5.4.394_snip/main?file=%2Fpackage.json%3A20%2C16-20%2C21&workspaceId=ws_K4X5TvYS522eNDW9RzSvNT
The public folder contains a pdf file named example.pdf.
I am trying to render the component client side as pdfjs-dist depends on browser related apis.
However I am facing an runtime issue which says:- Object.defineProperty called on non-object
I tried searching for a solution in stackoverflow, gemini and chatgpt but couldn't find a solution.
Would be thankful if I can get some ideas so that I can proceed further.
Kind Regards,
Aditya
Beta Was this translation helpful? Give feedback.
All reactions