Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 运行时错误非法状态:内容查询节点必须是索引0处指令的子节点!离子的_Angular_Ionic Framework_Angularjs Directive_Ionic3 - Fatal编程技术网

Angular 运行时错误非法状态:内容查询节点必须是索引0处指令的子节点!离子的

Angular 运行时错误非法状态:内容查询节点必须是索引0处指令的子节点!离子的,angular,ionic-framework,angularjs-directive,ionic3,Angular,Ionic Framework,Angularjs Directive,Ionic3,我正在制作一款离子型应用程序。我以前从未见过这个错误,如果有人记录了这个问题,我甚至无法在互联网上找到任何地方 我甚至无法找出到底是什么导致了这个问题,因为我在错误日志中找不到任何有用的东西 有没有人遇到过这个问题?如果有,你是如何解决的 Error: Illegal State: Content Query nodes need to be children of directives, at index 0! at d (http://localhost:8100/build/polyfil

我正在制作一款离子型应用程序。我以前从未见过这个错误,如果有人记录了这个问题,我甚至无法在互联网上找到任何地方

我甚至无法找出到底是什么导致了这个问题,因为我在错误日志中找不到任何有用的东西

有没有人遇到过这个问题?如果有,你是如何解决的

Error: Illegal State: Content Query nodes need to be children of directives, at index 0!
at d (http://localhost:8100/build/polyfills.js:3:3991)
at validateNode (http://localhost:8100/build/main.js:12307:19)
at viewDef (http://localhost:8100/build/main.js:12204:9)
at View_IonicApp_0 (ng:///IonicModule/IonicApp.ngfactory.js:11:10)
at proxyClass (http://localhost:8100/build/main.js:102775:29)
at resolveViewDefinition (http://localhost:8100/build/main.js:9289:17)
at createViewNodes (http://localhost:8100/build/main.js:12399:56)
at createRootView (http://localhost:8100/build/main.js:12343:5)
at callWithDebugContext (http://localhost:8100/build/main.js:13558:42)
at Object.debugCreateRootView [as createRootView] (http://localhost:8100/build/main.js:13018:12)
at ComponentFactory_.create (http://localhost:8100/build/main.js:10264:46)
at ComponentFactoryBoundToModule.create (http://localhost:8100/build/main.js:3800:29)
at ApplicationRef_.bootstrap (http://localhost:8100/build/main.js:5384:57)
at http://localhost:8100/build/main.js:5173:79
at Array.forEach (native)

My package.json文件:

{
  "name": "ionic-hello-world",
  "version": "0.0.0",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/common": "^4.1.3",
    "@angular/compiler": "4.0.2",
    "@angular/compiler-cli": "4.0.2",
    "@angular/core": "^4.1.3",
    "@angular/forms": "4.0.2",
    "@angular/http": "4.0.2",
    "@angular/platform-browser": "4.0.2",
    "@angular/platform-browser-dynamic": "4.0.2",
    "@ionic-native/core": "3.6.1",
    "@ionic-native/geolocation": "^3.6.1",
    "@ionic-native/network": "^3.8.0",
    "@ionic-native/splash-screen": "3.6.1",
    "@ionic-native/status-bar": "3.6.1",
    "@ionic/storage": "2.0.1",
    "@types/decimal.js": "0.0.21-alpha",
    "@types/leaflet": "^1.0.60",
    "@types/long": "^3.0.31",
    "@types/node": "^7.0.22",
    "angular2-uuid": "^1.1.1",
    "aws-sdk": "^2.49.0",
    "cordova-android": "^6.2.3",
    "cordova-plugin-compat": "^1.1.0",
    "cordova-plugin-console": "1.0.5",
    "cordova-plugin-device": "1.1.4",
    "cordova-plugin-geolocation": "^2.4.3",
    "cordova-plugin-network-information": "^1.3.3",
    "cordova-plugin-splashscreen": "~4.0.1",
    "cordova-plugin-statusbar": "2.2.2",
    "cordova-plugin-whitelist": "1.3.1",
    "decimal": "0.0.2",
    "ionic-angular": "3.1.1",
    "ionic-plugin-keyboard": "~2.2.1",
    "ionicons": "3.0.0",
    "istanbul": "^0.4.5",
    "leaflet": "^1.0.3",
    "nodes2ts": "^1.1.9",
    "rxjs": "5.1.1",
    "sw-toolbox": "3.4.0",
    "zone.js": "^0.8.10"
  },
  "devDependencies": {
    "@angular/common": "^4.1.3",
    "@ionic/app-scripts": "1.3.7",
    "@ionic/cli-plugin-ionic-angular": "1.2.0",
    "@types/node": "^7.0.22",
    "typescript": "^2.2.1"
  },
  "cordovaPlugins": [
    "cordova-plugin-whitelist",
    "cordova-plugin-console",
    "cordova-plugin-device",
    "cordova-plugin-statusbar",
    "ionic-plugin-keyboard",
    "cordova-plugin-splashscreen"
  ],
  "cordovaPlatforms": [],
  "description": "s: An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-console": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-whitelist": {},
      "ionic-plugin-keyboard": {},
      "cordova-plugin-geolocation": {}
    },
    "platforms": [
      "android"
    ]
  }
}

我也有同样的问题。解决方案是更新依赖项。这是来自的设置。我刚刚更新了我的package.json,使用了最新的angular和ionic angular引用、npm安装,一切都恢复正常

{
“名称”:“爱奥尼亚会议应用程序”,
“版本”:“0.0.0”,
“说明”:“爱奥尼亚会议应用程序”,
“许可证”:“Apache-2.0”,
“存储库”:{
“类型”:“git”,
“url”:”https://github.com/ionic-team/ionic-conference-app.git"
},
“脚本”:{
“构建”:“离子应用程序脚本构建”,
“清洁”:“爱奥尼亚应用程序脚本清洁”,
“爱奥尼亚:构建”:“爱奥尼亚应用程序脚本构建”,
“爱奥尼亚:服务”:“爱奥尼亚应用程序脚本服务”
},
“依赖项”:{
“@angular/common”:“4.1.2”,
“@angular/compiler”:“4.1.2”,
“@angular/compiler cli”:“4.1.2”,
“@angular/core”:“4.1.2”,
“@angular/forms”:“4.1.2”,
“@angular/http”:“4.1.2”,
“@角度/平台浏览器”:“4.1.2”,
“@angular/platform browser dynamic”:“4.1.2”,
“@ionic native/core”:“3.10.2”,
“@ionic native/应用程序内浏览器”:“3.10.2”,
“@ionic native/splash screen”:“3.10.2”,
“@ionic native/状态栏”:“3.10.2”,
“@ionic/storage”:“2.0.1”,
“离子角”:“3.3.0”,
“ionicons”:“3.0.0”,
“rxjs”:“5.1.1”,
“软件工具箱”:“3.4.0”,
“zone.js”:“0.8.11”
},
“依赖性”:{
“@IONAL/app脚本”:“1.3.7”,
“@ionic/cli插件”:“1.2.0”,
“类型脚本”:“2.3.3”
},
“配置”:{}
}