@@ -55,6 +55,9 @@ exports._resolveComponent = function (id, cb) {
if (process.env.NODE_ENV !== 'production') {
_.assertAsset(factory, 'component', id)
}
+ if (!factory) {
+ return
+ }
// async component factory
if (!factory.options) {
if (factory.resolved) {
@@ -423,5 +423,14 @@ if (_.inBrowser) {
expect(hasWarned(_, 'cannot mount component "test" on already mounted element')).toBe(true)
})
+ it('not found component should not throw', function () {
+ expect(function () {
+ new Vue({
+ el: el,
+ template: '<div v-component="non-existent"></div>'
+ })
+ }).not.toThrow()
+