Skip to content
New issue

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

Couldn't upload asset in react native #467

Open
limouren opened this issue Nov 6, 2018 · 2 comments
Open

Couldn't upload asset in react native #467

limouren opened this issue Nov 6, 2018 · 2 comments
Labels

Comments

@limouren
Copy link
Contributor

limouren commented Nov 6, 2018

Save a record leading to an asset save, an error will be thrown:

simulator screen shot - iphone se - 2018-11-06 at 16 01 41

The offending line should be:

if (asset.file instanceof Buffer) {

  • Skygear SDK Date/Version: 1.6.0
  • JS runtime: react-native
  • Skygear Server Date/Version:
  • [*] Is this a regression?
  • [*] Attached logs, screenshots

Expected Results

Record save successfully

Actual Results

Shown above.

Steps to reproduce

@limouren
Copy link
Contributor Author

limouren commented Nov 6, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants