【发布时间】:2015-07-10 06:21:46
【问题描述】:
我在 Yeoman 中创建了一个 Ionic 项目。当ionic serve 命令显示多个地址时,我选择了选项 localhost。但是当我运行应用程序时,它在控制台上显示错误
ReferenceError : ionic is not defined
这是我正在遵循的完整过程 -
Running live reload server: http://localhost:35729
Watching : [ 'www/**/*', '!www/lib/**/*' ]
Running dev server: http://localhost:8100
Ionic server commands, enter:
restart or r to restart the client app from the root
goto or g and a url to have the app navigate to the given url
consolelogs or c to enable/disable console log output
serverlogs or s to enable/disable server log output
quit or q to shutdown the server and exit
ionic $ c
Console log output: enabled
Loading: /?restart=998712
ionic $ 0 129599 error ReferenceError: ionic is not defined, http://localhost:8100/?ionicplatform=ios, Line: 103
0 129653 error ReferenceError: ionic is not defined, http://localhost:8100/?ionicplatform=android, Line: 103
我无法理解为什么这个错误会在控制台上闪烁。 Ionic 安装在我的系统上,我已经使用ionic 命令对其进行了测试。这是我得到的错误截图。我还检查了系统中的 ionic.config 文件,它的服务器地址已经以下列方式存在
"ionicServeAddress": "localhost"
【问题讨论】:
-
您的 ionic.project 文件中是否定义了 gulp 任务?
标签: cordova ionic-framework yeoman