{"action":"created","issue":{"url":"https://api.github.com/repos/sorrycc/dva/issues/14","repository_url":"https://api.github.com/repos/sorrycc/dva","labels_url":"https://api.github.com/repos/sorrycc/dva/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/sorrycc/dva/issues/14/comments","events_url":"https://api.github.com/repos/sorrycc/dva/issues/14/events","html_url":"https://github.com/sorrycc/dva/pull/14","id":166015230,"number":14,"title":"fix:app.start的container传入null时报错不明确","user":{"login":"LeuisKen","id":7701575,"avatar_url":"https://avatars.githubusercontent.com/u/7701575?v=3","gravatar_id":"","url":"https://api.github.com/users/LeuisKen","html_url":"https://github.com/LeuisKen","followers_url":"https://api.github.com/users/LeuisKen/followers","following_url":"https://api.github.com/users/LeuisKen/following{/other_user}","gists_url":"https://api.github.com/users/LeuisKen/gists{/gist_id}","starred_url":"https://api.github.com/users/LeuisKen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeuisKen/subscriptions","organizations_url":"https://api.github.com/users/LeuisKen/orgs","repos_url":"https://api.github.com/users/LeuisKen/repos","events_url":"https://api.github.com/users/LeuisKen/events{/privacy}","received_events_url":"https://api.github.com/users/LeuisKen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-18T03:56:29Z","updated_at":"2016-07-20T06:33:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sorrycc/dva/pulls/14","html_url":"https://github.com/sorrycc/dva/pull/14","diff_url":"https://github.com/sorrycc/dva/pull/14.diff","patch_url":"https://github.com/sorrycc/dva/pull/14.patch"},"body":"使用`document.getElementById()`等方法，获取不到DOM元素时会返回null。此时报错行在https://github.com/sorrycc/dva/blob/master/src/utils.js#L22 ，错误内容为`Uncaught TypeError: Cannot read property 'nodeType' of null`。表意不明。\r\n\r\n参考源码：https://github.com/sorrycc/dva/blob/master/src/index.js#L57 。可以知道预期报错内容为：`Container must be DOMElement.`。与预期不符。\r\n\r\n修复了这个问题之后，我觉得`check`函数传入的`error`参数应该调整成一个函数，这样可以获取到传入的`value`，错误信息能够调整为：`Container must be DOMElement, but got ${typeof value}`"},"comment":{"url":"https://api.github.com/repos/sorrycc/dva/issues/comments/233852295","html_url":"https://github.com/sorrycc/dva/pull/14#issuecomment-233852295","issue_url":"https://api.github.com/repos/sorrycc/dva/issues/14","id":233852295,"user":{"login":"sorrycc","id":35128,"avatar_url":"https://avatars.githubusercontent.com/u/35128?v=3","gravatar_id":"","url":"https://api.github.com/users/sorrycc","html_url":"https://github.com/sorrycc","followers_url":"https://api.github.com/users/sorrycc/followers","following_url":"https://api.github.com/users/sorrycc/following{/other_user}","gists_url":"https://api.github.com/users/sorrycc/gists{/gist_id}","starred_url":"https://api.github.com/users/sorrycc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sorrycc/subscriptions","organizations_url":"https://api.github.com/users/sorrycc/orgs","repos_url":"https://api.github.com/users/sorrycc/repos","events_url":"https://api.github.com/users/sorrycc/events{/privacy}","received_events_url":"https://api.github.com/users/sorrycc/received_events","type":"User","site_admin":false},"created_at":"2016-07-20T06:33:31Z","updated_at":"2016-07-20T06:33:31Z","body":"感谢 pr，不过我觉得这个问题应该完善 is.element 的逻辑，n.nodeType 之前多一层非空判断，https://github.com/sorrycc/dva/blob/master/src/utils.js#L22 。"}}
{"actor":{"display_login":"sorrycc"}}