Nativescript构建旧代码 [英] Nativescript builds old code

查看:51
本文介绍了Nativescript构建旧代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有angular 2 nativescript项目,并且使用

I have angular 2 nativescript project and I use

tns livesync android --watchtns run android

以查看真实设备和仿真器上的更改.它通常可以正常工作,但是在某个时候它会开始构建和同步旧代码,并根据该代码引发JS错误.

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.

通常可以通过重置整个项目(删除平台,节点模块,挂钩)并tns install所有内容来解决. 当我添加新的节点模块和/或新的自定义组件时,通常会终止生命同步并执行tns build android. 无论使用哪种手表,都可以使用旧的html和旧的js(从ts转换而来).

It's usually solvable by reseting the whole project (remove platforms, node-modules, hooks) and tns install everything back. When I add new node modules and/or new custom components, I usually kill the lifesync and do the tns build android. Regardless of this lifewatch serves old html and old js (transpiled from ts).

当我在终端中看到输出时,我复制了导致错误的元素,并在整个项目中搜索这些元素.但是,无处可寻.首先,我认为它们仍位于platforms文件夹中,但没有,因此必须将它们缓存在某个位置.有人也注意到吗?如何解决这个问题/解决这个问题?

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. Has anyone noticed this as well? How to fix this / work around this ?

我正在使用Webstorm-尝试使缓存无效并重新启动.没有帮助.决定切换到Visual Studio Code,但它确实在做同样的事情.我什至删除了.gradle文件夹以删除缓存的文件.没有帮助.

I am using Webstorm - tried invalidating cache and restart. Didn't help. Decided to switch over to Visual Studio Code, but it is doing the exact same thing. I have even deleted .gradle folder in order to delete cached files. Didn't help.

推荐答案

似乎在下一发行版中已解决此问题(不幸的是,当前版本不是2.2).阅读他们的 github .确实是CLI同步错误的文件.

It seems this is fixed in next release (unfortunately not the current 2.2). Read up on their github . It was indeed the CLI syncing wrong files.

这篇关于Nativescript构建旧代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆