You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vite replace process.env.NODE_ENV in globalThis.process.env.NODE_ENV and e.process.env.NODE_ENV (min version of openpgp@5.0.0-3). It's broke start of openpgp module. Not sure is it bug of Vite, so I report it to openpgp too — Cannot import library with Vite openpgpjs/openpgpjs#1332;
Vite get error when try to build app with openpgp@5.0.0-3 import.
With Vite 2.5, it still doesn't work when calling import * as openpgp from "openpgp";, but it works when calling import * as openpgp from "openpgp/dist/openpgp";. Not sure why.
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 ofopenpgp@5.0.0-3
). 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;openpgp@5.0.0-3
import.Reproduction
openpgp@5.0.0-3
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: