bmob / hydrogen-js-sdk

Bmob 新版ES6 SDK, 新版语法整合微信小程序、快应用、抖音小程序、H5等
https://www.bmobapp.com/
202 stars 287 forks source link

Uncaught ReferenceError: global is not defined #81

Closed npmrun closed 2 years ago

npmrun commented 3 years ago

没人维护了吗 image 我是按流程做的:

npm install hydrogen-js-sdk 
Bmob.initialize("你的Secret Key", "你的API 安全码");

然后就报错了

magic007 commented 2 years ago

没人维护了吗 image 我是按流程做的:

npm install hydrogen-js-sdk 
Bmob.initialize("你的Secret Key", "你的API 安全码");

然后就报错了

你这是什么环境下

npmrun commented 2 years ago

没人维护了吗 image 我是按流程做的:

npm install hydrogen-js-sdk 
Bmob.initialize("你的Secret Key", "你的API 安全码");

然后就报错了

你这是什么环境下

浏览器环境啊

longer96 commented 2 years ago

https://github.com/vitejs/vite/issues/2618

vite版本环境导致

npmrun commented 2 years ago

谢谢,是用的vite

longer96 commented 2 years ago

For reference, if you only need to shim global, you can add

to your index.html