{"action":"created","issue":{"url":"https://api.github.com/repos/vuejs/vue/issues/10102","repository_url":"https://api.github.com/repos/vuejs/vue","labels_url":"https://api.github.com/repos/vuejs/vue/issues/10102/labels{/name}","comments_url":"https://api.github.com/repos/vuejs/vue/issues/10102/comments","events_url":"https://api.github.com/repos/vuejs/vue/issues/10102/events","html_url":"https://github.com/vuejs/vue/issues/10102","id":451877554,"node_id":"MDU6SXNzdWU0NTE4Nzc1NTQ=","number":10102,"title":"Stringify Vue instance","user":{"login":"miljan-aleksic","id":513275,"node_id":"MDQ6VXNlcjUxMzI3NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/513275?v=4","gravatar_id":"","url":"https://api.github.com/users/miljan-aleksic","html_url":"https://github.com/miljan-aleksic","followers_url":"https://api.github.com/users/miljan-aleksic/followers","following_url":"https://api.github.com/users/miljan-aleksic/following{/other_user}","gists_url":"https://api.github.com/users/miljan-aleksic/gists{/gist_id}","starred_url":"https://api.github.com/users/miljan-aleksic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miljan-aleksic/subscriptions","organizations_url":"https://api.github.com/users/miljan-aleksic/orgs","repos_url":"https://api.github.com/users/miljan-aleksic/repos","events_url":"https://api.github.com/users/miljan-aleksic/events{/privacy}","received_events_url":"https://api.github.com/users/miljan-aleksic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-06-04T08:59:54Z","updated_at":"2019-06-04T09:04:26Z","closed_at":null,"author_association":"NONE","body":"### Version\r\n2.6.10\r\n\r\n### Reproduction link\r\n[https://codesandbox.io/s/vue-stringify-instance-2h78n](https://codesandbox.io/s/vue-stringify-instance-2h78n)\r\n\r\n### Steps to reproduce\r\nOpen the link, the error is reproduce right away as the code tries to serliaze the Vue instance.\r\n\r\n### What is expected?\r\nBeing able to serlialize the Vue instance.\r\n\r\n### What is actually happening?\r\nIs not possible as the Vue prototype is missing the toJSON method.\r\n\r\n---\r\nThe code is using `telejson` as the stringify library in order to remove circular references. Is the same utility used by Storybook 5 which will rise those errors in diferent scenarios, as for example when using the Action addon and passing as argument a Vue instance.\r\n\r\n<!-- generated by vue-issues. DO NOT REMOVE -->"},"comment":{"url":"https://api.github.com/repos/vuejs/vue/issues/comments/498587388","html_url":"https://github.com/vuejs/vue/issues/10102#issuecomment-498587388","issue_url":"https://api.github.com/repos/vuejs/vue/issues/10102","id":498587388,"node_id":"MDEyOklzc3VlQ29tbWVudDQ5ODU4NzM4OA==","user":{"login":"posva","id":664177,"node_id":"MDQ6VXNlcjY2NDE3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/664177?v=4","gravatar_id":"","url":"https://api.github.com/users/posva","html_url":"https://github.com/posva","followers_url":"https://api.github.com/users/posva/followers","following_url":"https://api.github.com/users/posva/following{/other_user}","gists_url":"https://api.github.com/users/posva/gists{/gist_id}","starred_url":"https://api.github.com/users/posva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/posva/subscriptions","organizations_url":"https://api.github.com/users/posva/orgs","repos_url":"https://api.github.com/users/posva/repos","events_url":"https://api.github.com/users/posva/events{/privacy}","received_events_url":"https://api.github.com/users/posva/received_events","type":"User","site_admin":false},"created_at":"2019-06-04T09:04:26Z","updated_at":"2019-06-04T09:04:26Z","author_association":"MEMBER","body":"Yeah, there isn't a default toJSON method on classes, it's something that needs to be implemented. But I don't see what production use would `toJSON` have for Vue.\r\n\r\nIf the use case for this is being able to log messages during testing, error reporting or for a component style guide (like storybook), it should be implemented by those libraries so it fits their need. We cannot provide a silver bullet, dev-only `toJSON`"}}
{"actor":{"display_login":"posva"}}