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

[bug] Setting options gives hasOwnProperty issue #396

Closed
natew opened this issue Dec 8, 2017 · 1 comment
Closed

[bug] Setting options gives hasOwnProperty issue #396

natew opened this issue Dec 8, 2017 · 1 comment

Comments

@natew
Copy link
Contributor

natew commented Dec 8, 2017

Case

Bug using collection.schema.options

Issue

Error I get is:

Uncaught (in promise) TypeError: Cannot read property 'hasOwnProperty' of undefined
    at checkField (schema-check.js:73)
    at traverse (schema-check.js:139)
    at traverse (schema-check.js:143)
    at validateFieldsDeep (schema-check.js:146)
    at checkSchema (schema-check.js:177)
    at hooks.js:100
    at Array.forEach (<anonymous>)
    at runPluginHooks (hooks.js:99)
    at Object.create (rx-schema.js:384)
    at RxDatabase._callee4$ (rx-database.js:619)

Here:

image

Info

  • Environment: Chrome latest

Code

Schema looks like:

{
  "primaryPath": "_id",
  "disableKeyCompression": true,
  "properties": {
    "id": {
      "primary": true,
      "type": "string"
    },
    "title": {
      "index": true,
      "type": "string"
    },
    "integration": {
      "type": "string"
    },
    "type": {
      "index": true,
      "type": "string"
    },
    "data": {
      "type": "object"
    },
    "author": {
      "type": "string"
    },
    "bucket": {
      "type": "string"
    },
    "url": {
      "unique": true,
      "type": "string"
    },
    "created": {
      "index": true,
      "type": "string"
    },
    "updated": {
      "index": true,
      "type": "string"
    },
    "createdAt": {
      "format": "date-time",
      "type": "string",
      "index": true
    },
    "updatedAt": {
      "format": "date-time",
      "type": "string",
      "index": true
    }
  },
  "type": "object",
  "required": [
    "title",
    "integration",
    "type",
    "created",
    "updated"
  ],
  "title": "things",
  "version": 0,
  "options": {
    "asyncMethods": {}
  }
}

This is from copy() so it removed the asyncMethods part, but asyncMethods looks like:

image

@natew
Copy link
Contributor Author

natew commented Dec 8, 2017

And immediately realized this is on the wrong place, yikes... (sorry)

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

1 participant