-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Vite don't work with openpgp package #3801
Comments
It seems like #3703 (merged in Vite 2.3.8) probably fixed this? |
With Vite 2.5, it still doesn't work when calling |
I was incorrect - this only works in a build, but not on a dev server. Looks like #3703 only affected the rollup build, not the dev server process. |
The repro is working for me now with Vite 2.8.6. I assume this is fixed by #5515 |
Describe the bug
I found two bugs, but maybe both have one origin:
process.env.NODE_ENV
inglobalThis.process.env.NODE_ENV
ande.process.env.NODE_ENV
(min version of[email protected]
). It's broke start ofopenpgp
module. Not sure is it bug of Vite, so I report it to openpgp too — Cannot import library with Vite openpgpjs/openpgpjs#1332;[email protected]
import.Reproduction
[email protected]
import * as openpgp from 'openpgp'
tomain.js
Or use prepared repo: https://github.com/langovoi/vite-openpgp
Reproduce first bug:
npm run dev
Screenshot of console
Screenshot of error in openpgp.js file
Reproduce second bug:
npm run build
System Info
Output of
npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers
:Used package manager: npm
The text was updated successfully, but these errors were encountered: