diff --git a/platform/nativescript/compiler/modules/router.js b/platform/nativescript/compiler/modules/router.js index fcf9f414..d6d801d1 100644 --- a/platform/nativescript/compiler/modules/router.js +++ b/platform/nativescript/compiler/modules/router.js @@ -3,7 +3,11 @@ import { addAttr } from 'compiler/helpers' function preTransformNode(el) { if (el.tag !== 'router-view') return - if (normalizeElementName(el.parent.tag) === 'nativeframe') { + if ( + el.parent && + el.parent.tag && + normalizeElementName(el.parent.tag) === 'nativeframe' + ) { addAttr(el.parent, 'hasRouterView', 'true') } }