Open limouren opened 6 years ago
If your app doesn't rely on Buffer, you could polyfill the global Buffer name to workaround it:
class FakeBuffer {}
if (typeof Buffer === 'undefined') global.Buffer = FakeBuffer;
Put it in your program's entry point.
Just did a search in source code. These are where the SDK use Buffer
.
https://github.com/SkygearIO/skygear-SDK-JS/blob/master/packages/skygear-core/lib/database.js#L780 https://github.com/SkygearIO/skygear-SDK-JS/blob/master/packages/skygear-core/lib/asset.js#L58
Save a record leading to an asset save, an error will be thrown:
The offending line should be: https://github.com/SkygearIO/skygear-SDK-JS/blob/c1a179043b7b3c3b46f5205f5633c8d444da3a78/packages/skygear-core/lib/database.js#L780
Expected Results
Record save successfully
Actual Results
Shown above.
Steps to reproduce
1. 2. 3.