We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When I use shpjs in a vanilla Vue3 app, I get this error:
shpjs
How to reproduce:
Create a new Vue3 app
npm create vue@latest
install dependencies:
npm install npm install shpjs --save
In App.vue import
App.vue
import shp from "shpjs"
then the error from above will appear.
The text was updated successfully, but these errors were encountered:
workaround:
add this to vite.config.ts (taken from here):
vite.config.ts
export default defineConfig({ define: { global: {}, }, })
also install buffer as dev dependency:
buffer
npm i -D buffer # or yarn add -D buffer
Sorry, something went wrong.
ol-util
我是这么解决的
import { Buffer } from 'buffer' window.Buffer = Buffer window.global = globalThis
我就是这么解决的 import { Buffer } from 'buffer' window.Buffer = Buffer window.global = globalThis
我就是这么解决的
在main.ts中使用即可
No branches or pull requests
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.
The text was updated successfully, but these errors were encountered: