【问题标题】:Ionic Serve Not Serving离子服务不服务
【发布时间】:2018-04-27 15:46:45
【问题描述】:

当我运行 ionic serve 时,它​​会构建应用程序但服务器没有运行。这是线索:

    Starting app-scripts server: --address 0.0.0.0 --port 8100 --livereload-port 35729 
--dev-logger-port 53703 --nobrowser - Ctrl+C to cancel
[17:55:35]  watch started ... 
[17:55:35]  build dev started ... 
[17:55:36]  clean started ... 
[17:55:36]  clean finished in 2 ms 
[17:55:36]  copy started ... 
[17:55:36]  deeplinks started ... 
[17:55:37]  deeplinks finished in 589 ms 
[17:55:37]  transpile started ... 
[17:55:44]  transpile finished in 7.38 s 
[17:55:44]  preprocess started ... 
[17:55:44]  copy finished in 8.56 s 
[17:55:44]  preprocess finished in 206 ms 
[17:55:44]  webpack started ... 

webpack 启动后,cli 退出,我看到了正常的终端提示。

尝试 npm run ionic:serve 命令会导致此错误:

TypeError: Cannot read property 'substr' of undefined

到目前为止,我已经重新安装了 ionic,结果相同。有点不知道怎么处理这个...

【问题讨论】:

    标签: ionic-framework ionic-cli


    【解决方案1】:

    原来这是在一个ts文件中创建多个组件类时造成的。将这些类分别拆分到各自的文件中即可解决问题。

    与此https://github.com/ionic-team/ionic-app-scripts/issues/796相关

    【讨论】:

      猜你喜欢
      • 2018-12-08
      • 2019-01-28
      • 1970-01-01
      • 1970-01-01
      • 2020-02-20
      • 2015-08-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多