Open JakobMiksch opened 8 months ago
workaround:
add this to vite.config.ts
(taken from here):
export default defineConfig({
define: {
global: {},
},
})
also install buffer
as dev dependency:
npm i -D buffer
# or
yarn add -D buffer
我是这么解决的
import { Buffer } from 'buffer'
window.Buffer = Buffer
window.global = globalThis
我就是这么解决的
import { Buffer } from 'buffer' window.Buffer = Buffer window.global = globalThis
在main.ts中使用即可
When I use
shpjs
in a vanilla Vue3 app, I get this error:How to reproduce:
Create a new Vue3 app
install dependencies:
In
App.vue
importthen the error from above will appear.