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

undefined value throws RangeError: Field name does not exist exception #78

Closed
danielwii opened this issue Mar 25, 2018 · 1 comment
Closed

Comments

@danielwii
Copy link

let autoFields   = autoMerge.init();
autoFields       = autoMerge.change(autoFields, 'v0-init', (doc) => {
  doc.fields = { name: undefined };
});

throws RangeError: Field name does not exist: name
runkit

@ept
Copy link
Member

ept commented Apr 16, 2018

Thanks for your report, @danielwii. Automerge doesn't support the use of undefined in data, since it doesn't exist in JSON. Please use null instead.

I have made a change f7e739a so that Automerge throws a more helpful error message when an unsupported datatype is used.

@ept ept closed this as completed Apr 16, 2018
ept added a commit that referenced this issue Apr 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants