How to use pdf.js-dist in next js #17523
Unanswered
Harsh-Sharma25
asked this question in
Q&A
Replies: 1 comment
-
Hello, is there any solution for this issue? I am getting below error when i upgrade pdfjs-dist version to 4.2.67 and i have added below script in both webconfigure.config.ts and angular.json but still am getting issue angular.json:
|
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
How to configure pdf.js-dist to be able to run in next js
next-js version:- 12.3.1
This is the error I get:
./node_modules/pdfjs-dist/build/pdf.mjs
Module parse failed: The top-level-await experiment is not enabled (set experiments.topLevelAwait: true to enabled it)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
Error: The top-level-await experiment is not enabled (set experiments.topLevelAwait: true to enabled it)
Even after enabling this in next-js config experiments.topLevelAwait. I still get the same error.
Beta Was this translation helpful? Give feedback.
All reactions