简体   繁体   English

Nativescript构建旧代码

[英]Nativescript builds old code

I have angular 2 nativescript project and I use 我有angular 2 nativescript项目,我用

tns livesync android --watch or tns run android tns livesync android --watchtns run android

to see changes on both real device and emulator. 查看真实设备和仿真器上的更改。 It usually works fine but at some point it starts building and syncing old code and throws JS errors based on that code. 它通常可以正常工作,但是在某个时候它会开始构建和同步旧代码,并根据该代码引发JS错误。

It's usually solvable by reseting the whole project (remove platforms, node-modules, hooks) and tns install everything back. 通常可以通过重置整个项目(删除平台,节点模块,挂钩)来解决,然后tns install所有内容。 When I add new node modules and/or new custom components, I usually kill the lifesync and do the tns build android . 当我添加新的节点模块和/或新的自定义组件时,通常会终止lifesync并执行tns build android Regardless of this lifewatch serves old html and old js (transpiled from ts). 无论使用哪种手表,都可以使用旧的html和旧的js(从ts转换而来)。

When I saw the output in the terminal I copied out the elements that caused an error and searched in the whole project for these elements. 当我在终端中看到输出时,我复制了导致错误的元素,并在整个项目中搜索这些元素。 However they are nowhere to be found. 但是,无处可寻。 First I thought they were still inside platforms folder, but no, so they must be cached somewhere. 首先,我认为它们仍位于platforms文件夹中,但没有,因此必须将它们缓存在某个位置。 Has anyone noticed this as well? 有人注意到吗? How to fix this / work around this ? 如何解决/解决这个问题?

I am using Webstorm - tried invalidating cache and restart. 我正在使用Webstorm-尝试使缓存无效并重新启动。 Didn't help. 没有帮助。 Decided to switch over to Visual Studio Code, but it is doing the exact same thing. 决定切换到Visual Studio Code,但它确实在做同样的事情。 I have even deleted .gradle folder in order to delete cached files. 我什至删除了.gradle文件夹以删除缓存的文件。 Didn't help. 没有帮助。

It seems this is fixed in next release (unfortunately not the current 2.2). 看来此问题已在下一版本中修复(不幸的是,当前版本不是2.2)。 Read up on their github . 在他们的github上阅读。 It was indeed the CLI syncing wrong files. 确实是CLI同步错误的文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM