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

JS: A non-empty ArrayBuffer, BufferView or Buffer is expected. #3536

Closed
kraenhansen opened this issue Jan 27, 2021 · 0 comments · Fixed by #3546
Closed

JS: A non-empty ArrayBuffer, BufferView or Buffer is expected. #3536

kraenhansen opened this issue Jan 27, 2021 · 0 comments · Fixed by #3546
Assignees

Comments

@kraenhansen
Copy link
Member

kraenhansen commented Jan 27, 2021

Goals

Setting a non-optional data property to an empty buffer.

Expected Results & Code Sample

I would expect the following test to pass:

const Realm = require("realm");
const realm = new Realm({
  schema: [{
    name: "Test",
    properties: { blob: 'data?' },
  }],
});

realm.write(() => {
  realm.create("Test", { blob: new ArrayBuffer(0) })
});

Actual Results

This error is thrown:

Error: A non-empty ArrayBuffer, BufferView or Buffer is expected.

Steps to Reproduce

Save the code above as index.js in an empty directory and run

npm init -y && npm install realm && node index.js

Version of Realm and Tooling

  • Realm JS SDK Version: 10.1.4
  • Node or React Native: Node
  • Client OS & Version: v12.20.0
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants