{"action":"created","issue":{"url":"https://api.github.com/repos/tommikaikkonen/redux-orm/issues/29","repository_url":"https://api.github.com/repos/tommikaikkonen/redux-orm","labels_url":"https://api.github.com/repos/tommikaikkonen/redux-orm/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/tommikaikkonen/redux-orm/issues/29/comments","events_url":"https://api.github.com/repos/tommikaikkonen/redux-orm/issues/29/events","html_url":"https://github.com/tommikaikkonen/redux-orm/issues/29","id":170015419,"number":29,"title":"Uncaught TypeError: model.invalidateClassCache is not a function","user":{"login":"gCardinal","id":1518536,"avatar_url":"https://avatars.githubusercontent.com/u/1518536?v=3","gravatar_id":"","url":"https://api.github.com/users/gCardinal","html_url":"https://github.com/gCardinal","followers_url":"https://api.github.com/users/gCardinal/followers","following_url":"https://api.github.com/users/gCardinal/following{/other_user}","gists_url":"https://api.github.com/users/gCardinal/gists{/gist_id}","starred_url":"https://api.github.com/users/gCardinal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gCardinal/subscriptions","organizations_url":"https://api.github.com/users/gCardinal/orgs","repos_url":"https://api.github.com/users/gCardinal/repos","events_url":"https://api.github.com/users/gCardinal/events{/privacy}","received_events_url":"https://api.github.com/users/gCardinal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-08T20:19:09Z","updated_at":"2016-08-15T22:09:08Z","closed_at":null,"body":"When following the examples in the documentation, I constantly get this error. It happens in the Schema, in the register method. When looping through the models being registered, the model's class doesn't have a invalidateClassCache method.\r\n\r\nIt's not impossible the problem is on my side, but there's one detail that is currently making me believe there is something more at play here: I have access to most, if not all, of the properties an object extending `Model` should have. I'm talking about things like `querySetClass` and `virtualFields`. I also seem to have a valid object when I use Chrome's console and break right before the error and instantiate the current model in the loop.\r\n\r\nI should also mention I'm using TypeScript, but this should not affect anything in the use of this library. Especially since you're using ES6. Note that even though my code right now is not following exactly the syntax of your example, it does compile to the equivalent and I did try following your exact syntax since TypeScript really doesn't mind if I use pure JS.\r\n\r\nThat being said, here's the code that's causing this error:\r\n\r\n```\r\n// Book.ts\r\nimport { fk, Model } from 'redux-orm';\r\n\r\nexport default class Book extends Model {\r\n    public static modelName: string = 'Book';\r\n    public static fields: any = {\r\n        author: fk('Author'),\r\n    };\r\n}\r\n\r\n// public static properties compile to Book.modelName and such\r\n```\r\n\r\n```\r\n// Schema.ts\r\nimport { Schema } from 'redux-orm';\r\nimport Book from 'models/Book';\r\n\r\nconst schema = new Schema();\r\nschema.register(Book);\r\n\r\nexport default schema;\r\n```\r\n\r\n```\r\n// RootReducer.ts\r\nimport { combineReducers } from 'redux';\r\nimport Schema from 'models/Schema';\r\n\r\nexport default combineReducers({\r\n    orm: Schema.reducer(),\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/tommikaikkonen/redux-orm/issues/comments/239944643","html_url":"https://github.com/tommikaikkonen/redux-orm/issues/29#issuecomment-239944643","issue_url":"https://api.github.com/repos/tommikaikkonen/redux-orm/issues/29","id":239944643,"user":{"login":"tommikaikkonen","id":2487359,"avatar_url":"https://avatars.githubusercontent.com/u/2487359?v=3","gravatar_id":"","url":"https://api.github.com/users/tommikaikkonen","html_url":"https://github.com/tommikaikkonen","followers_url":"https://api.github.com/users/tommikaikkonen/followers","following_url":"https://api.github.com/users/tommikaikkonen/following{/other_user}","gists_url":"https://api.github.com/users/tommikaikkonen/gists{/gist_id}","starred_url":"https://api.github.com/users/tommikaikkonen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tommikaikkonen/subscriptions","organizations_url":"https://api.github.com/users/tommikaikkonen/orgs","repos_url":"https://api.github.com/users/tommikaikkonen/repos","events_url":"https://api.github.com/users/tommikaikkonen/events{/privacy}","received_events_url":"https://api.github.com/users/tommikaikkonen/received_events","type":"User","site_admin":false},"created_at":"2016-08-15T22:09:08Z","updated_at":"2016-08-15T22:09:08Z","body":"That's weird, your code looks correct. Is your build system resolving `import Book from 'models/Book'` to the correct file? Without adding custom resolve paths in webpack, to get a file relative to the directory of the current file I need to use the relative import `./models/Book`. If the import is resolving to `undefined` or an empty object, that would explain the exception."}}
{"actor":{"display_login":"tommikaikkonen"}}