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.
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.