更新到 Ionic 6.0.5 / Angular 13.2.2 后,我遇到了一个找不到解决方案的问题。在带有 的开发环境中ionic serve
,会定期启动重新编译,而没有任何更改。
在浏览器控制台中它说:
[webpack-dev-server] App updated. Recompiling...
[webpack-dev-server] Nothing changed.
[webpack-dev-server] App updated. Recompiling...
[webpack-dev-server] Nothing changed.
[webpack-dev-server] App updated. Recompiling...
[webpack-dev-server] Nothing changed.
...
最初,每隔几分钟重新编译一次。但是,开发服务器运行的时间越长,似乎重新编译调用就越频繁。
有没有人有同样的问题?关于我还能尝试什么的任何提示?
已经尝试过:
- node_modules 已删除
- 删除 package-lock.json
- 再次运行 npm install
ionic serve --verbose
重新编译时的输出:
[ng] <t> [webpack.cache.PackFileCacheStrategy] restore cache container: 14.200537 ms
[ng] <t> [webpack.cache.PackFileCacheStrategy] check build dependencies: 0.147219 ms
[ng] <t> [webpack.cache.PackFileCacheStrategy] restore cache content metadata: 90.696713 ms
[ng] [webpack.cache.PackFileCacheStrategy] Pack got invalid because of write to: ProgressPlugin|counts
[ng] [webpack.cache.PackFileCacheStrategy] Storing pack...
[ng] [webpack.cache.PackFileCacheStrategy] 1 fresh items in cache put into pack 3
-> 所以这个过程似乎是在 Webpack ProgressPlugin|counts 的某个地方触发的。还有这张票: https ://github.com/webpack/webpack/issues/14946 这又在 Angular Cli 票中链接,但现在应该解决了: https ://github.com/角度/角度-cli/issues/22323
我不明白我的开发环境出了什么问题。没有其他人有这个问题吗?
感谢您的帮助和建议!