-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pdfjd-dist v4] Top-level await is not available #115
Comments
npm install vite-plugin-top-level-await -D |
vite 配置 |
try this
|
this is an issue with pdfjs and esbuild |
This method works during development, but ERROR: Top-level await is not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari14" + 2 overrides) @lhiro Thanks~ |
Try this, it's not recommend to change the build target, we just add optimizeDeps: {
esbuildOptions: {
supported: {
'top-level-await': true,
},
},
},
esbuild: {
supported: {
'top-level-await': true,
},
}, |
🎉 @lhiro Thank you. After removing the |
error log:
After upgrading to
1.10.0
, the use of top await inpdfjs-dist
v4+ caused compilation errors on my end. I tried downgrading to1.9.7
, which resolved the issue. Then, I used the@tato30/[email protected]
+ vite-plugin-top-level-await plugin to fix the error.I submitted this issue in order to alert other users about how to resolve this problem.
The text was updated successfully, but these errors were encountered: