{"action":"created","issue":{"url":"https://api.github.com/repos/loganfsmyth/babel-plugin-transform-decorators-legacy/issues/57","repository_url":"https://api.github.com/repos/loganfsmyth/babel-plugin-transform-decorators-legacy","labels_url":"https://api.github.com/repos/loganfsmyth/babel-plugin-transform-decorators-legacy/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/loganfsmyth/babel-plugin-transform-decorators-legacy/issues/57/comments","events_url":"https://api.github.com/repos/loganfsmyth/babel-plugin-transform-decorators-legacy/issues/57/events","html_url":"https://github.com/loganfsmyth/babel-plugin-transform-decorators-legacy/issues/57","id":203612439,"number":57,"title":"Cannot assign to read only property of object","user":{"login":"pleerock","id":1753397,"avatar_url":"https://avatars3.githubusercontent.com/u/1753397?v=4","gravatar_id":"","url":"https://api.github.com/users/pleerock","html_url":"https://github.com/pleerock","followers_url":"https://api.github.com/users/pleerock/followers","following_url":"https://api.github.com/users/pleerock/following{/other_user}","gists_url":"https://api.github.com/users/pleerock/gists{/gist_id}","starred_url":"https://api.github.com/users/pleerock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pleerock/subscriptions","organizations_url":"https://api.github.com/users/pleerock/orgs","repos_url":"https://api.github.com/users/pleerock/repos","events_url":"https://api.github.com/users/pleerock/events{/privacy}","received_events_url":"https://api.github.com/users/pleerock/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2017-01-27T11:23:15Z","updated_at":"2017-12-05T12:09:16Z","closed_at":null,"author_association":"NONE","body":"I have such error: `Cannot assign to read only property 'name' of object '#<Category>'` when I use non initialized properties decorated with decorators and then trying to assign values to these properties.\r\n\r\n```javascript\r\nimport {Entity, PrimaryColumn, Column} from \"typeorm\";\r\n\r\n@Entity()\r\nexport class Category {\r\n\r\n    @PrimaryColumn(\"int\", { generated: true })\r\n    id;\r\n\r\n    @Column(\"string\")\r\n    name;\r\n\r\n}\r\n```\r\n\r\nSolution is to do it this way:\r\n\r\n```javascript\r\nimport {Entity, PrimaryColumn, Column} from \"typeorm\";\r\n\r\n@Entity()\r\nexport class Category {\r\n\r\n    @PrimaryColumn(\"int\", { generated: true })\r\n    id = undefined;\r\n\r\n    @Column(\"string\")\r\n    name = \"\";\r\n\r\n}\r\n```\r\n\r\nWhich is ugly. I guess the reason is that it does not make descriptor writable. Is there any better solution for this problem?"},"comment":{"url":"https://api.github.com/repos/loganfsmyth/babel-plugin-transform-decorators-legacy/issues/comments/349285809","html_url":"https://github.com/loganfsmyth/babel-plugin-transform-decorators-legacy/issues/57#issuecomment-349285809","issue_url":"https://api.github.com/repos/loganfsmyth/babel-plugin-transform-decorators-legacy/issues/57","id":349285809,"user":{"login":"chbdetta","id":2610489,"avatar_url":"https://avatars1.githubusercontent.com/u/2610489?v=4","gravatar_id":"","url":"https://api.github.com/users/chbdetta","html_url":"https://github.com/chbdetta","followers_url":"https://api.github.com/users/chbdetta/followers","following_url":"https://api.github.com/users/chbdetta/following{/other_user}","gists_url":"https://api.github.com/users/chbdetta/gists{/gist_id}","starred_url":"https://api.github.com/users/chbdetta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chbdetta/subscriptions","organizations_url":"https://api.github.com/users/chbdetta/orgs","repos_url":"https://api.github.com/users/chbdetta/repos","events_url":"https://api.github.com/users/chbdetta/events{/privacy}","received_events_url":"https://api.github.com/users/chbdetta/received_events","type":"User","site_admin":false},"created_at":"2017-12-05T12:09:16Z","updated_at":"2017-12-05T12:09:16Z","author_association":"NONE","body":"Is this solved?"}}
{"actor":{"display_login":"chbdetta"}}