{"action":"created","issue":{"url":"https://api.github.com/repos/mobxjs/mobx-state-tree/issues/879","repository_url":"https://api.github.com/repos/mobxjs/mobx-state-tree","labels_url":"https://api.github.com/repos/mobxjs/mobx-state-tree/issues/879/labels{/name}","comments_url":"https://api.github.com/repos/mobxjs/mobx-state-tree/issues/879/comments","events_url":"https://api.github.com/repos/mobxjs/mobx-state-tree/issues/879/events","html_url":"https://github.com/mobxjs/mobx-state-tree/issues/879","id":333077729,"node_id":"MDU6SXNzdWUzMzMwNzc3Mjk=","number":879,"title":"Destroy / Remove Error.","user":{"login":"chobo2","id":321584,"node_id":"MDQ6VXNlcjMyMTU4NA==","avatar_url":"https://avatars2.githubusercontent.com/u/321584?v=4","gravatar_id":"","url":"https://api.github.com/users/chobo2","html_url":"https://github.com/chobo2","followers_url":"https://api.github.com/users/chobo2/followers","following_url":"https://api.github.com/users/chobo2/following{/other_user}","gists_url":"https://api.github.com/users/chobo2/gists{/gist_id}","starred_url":"https://api.github.com/users/chobo2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chobo2/subscriptions","organizations_url":"https://api.github.com/users/chobo2/orgs","repos_url":"https://api.github.com/users/chobo2/repos","events_url":"https://api.github.com/users/chobo2/events{/privacy}","received_events_url":"https://api.github.com/users/chobo2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-17T17:13:42Z","updated_at":"2018-06-18T07:53:15Z","closed_at":null,"author_association":"NONE","body":"Hi\r\n\r\nI been following the egg head tutorials and everytime I get to the destroy part my code fails. I took one of the codepen examples and modified it and I get the same error. \r\n\r\nAm I doing something wrong or is this a bug?\r\n\r\nhttps://codesandbox.io/s/322mz36moq\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mobxjs/mobx-state-tree/issues/comments/397970907","html_url":"https://github.com/mobxjs/mobx-state-tree/issues/879#issuecomment-397970907","issue_url":"https://api.github.com/repos/mobxjs/mobx-state-tree/issues/879","id":397970907,"node_id":"MDEyOklzc3VlQ29tbWVudDM5Nzk3MDkwNw==","user":{"login":"mweststrate","id":1820292,"node_id":"MDQ6VXNlcjE4MjAyOTI=","avatar_url":"https://avatars0.githubusercontent.com/u/1820292?v=4","gravatar_id":"","url":"https://api.github.com/users/mweststrate","html_url":"https://github.com/mweststrate","followers_url":"https://api.github.com/users/mweststrate/followers","following_url":"https://api.github.com/users/mweststrate/following{/other_user}","gists_url":"https://api.github.com/users/mweststrate/gists{/gist_id}","starred_url":"https://api.github.com/users/mweststrate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mweststrate/subscriptions","organizations_url":"https://api.github.com/users/mweststrate/orgs","repos_url":"https://api.github.com/users/mweststrate/repos","events_url":"https://api.github.com/users/mweststrate/events{/privacy}","received_events_url":"https://api.github.com/users/mweststrate/received_events","type":"User","site_admin":false},"created_at":"2018-06-18T07:53:15Z","updated_at":"2018-06-18T07:53:15Z","author_association":"MEMBER","body":"The problem is \r\n\r\n```javascript\r\nfunction deleteTodo(d) {\r\n            console.log('fdafadf', d)\r\n            destroy(d)\r\n        }\r\n```\r\n\r\nThe `console.log` causes the exception here. The reason is that console.log is actually an async operation, so although you invoke the console before the destroy, `d` will only be evaluated and pretty printed when the console flushes in the future. Removing the console statement, or serializing `d` immediately (for example by using `getSnapshot(d)` or even `console.log(\"fdafadf\" + d)` will cause `d` to be 'serialized' immediately and will avoid the exception\r\n\r\n(also note the React key warning should be fixed)\r\n\r\n\r\n"}}
{"actor":{"display_login":"mweststrate"}}