Playground/Preview app [iOS] Does not flush previous instance.
Dear friend, we want to specify that this repo is {N} Playground related. Please use it to provide feedback or report an issue related to {N} Playground only. If your issue is related to {N} itself please report it to the {N} repo or search for a solution in Stack Overflow. All issues which are not related to {N} Playground will be closed.
We appreciate your feedback! While we are doing all we can to take care of every issue, sometimes we get overwhelmed. Because of that, we will consider issues that are not constructive or problems that cannot be reproduced "dead". Additionally, we will treat feature requests or bug reports with unanswered questions regarding the behavior/reproduction for more than 20 days "dead". All "dead" issues will get closed.
Please, provide the details below:
Did you search for the problem in other open issues in this repo?
Yes
Tell us about the problem
Please, ensure your title is less than 63 characters long and starts with a capital letter.
Did you try it outside of {N} Playground?
- Yes - it has the same behavior as in the playground
- Yes - but the behavior is different (give more information)
- No No
Which browser are you using?
- Chrome
- Safari
- Mozilla
- IE
Are there any errors/warnings logged in your browser console?
Which platform(s) does your issue occur on?
- iOS
- Android
- Both iOS
Are there any entries logged in the Device Logs tab?
Please provide the following information shown in the devices tab in the playground:
- Model
- OS version
- Preview app version
- Runtime version iphone 8 iOS 12.2
Please tell us how to recreate the issue with as much detail as possible.
The best approach would be to get your code running in the {N} Playground and share the link with us, along with any additional details or steps to reproduce needed for examining the issue there. This happens after I get an error while viewing a playground. The next time preview shows the exact same error. It timestamps with the current time, but it shows the old error with the old code. For example, yesterday I tested my own code. Got an "expected ','" error. This morn I tried to run this playground: https://play.nativescript.org/?template=play-vue&id=jdQR5Q The result was the error from yesterday, quoting code unique to yesterday's vue code. It was timestamped with this morn's time, but the error clearly did not belong with the playground I asked for.
Force-stopping the playground/preview apps doesn't consistently help.
This has happened consistently for awhile, and makes development/debugging really difficult.
This was not a one-off. It's happened again severely several times this week.
Also, even scanning the feature playground at https://play.nativescript.org/ will continue to show (on iPhone) the error from my own app. Eventually this resolves.
We have very dicey Internet here, so that may be part of the problem. Still,
Yes. Here I have the same error getting from NativeScript Playground. I am using Chrome and Firefox and try to sync the updated version to iPhone 8 Plus (iOS 12.3.2). Preview keep procedure the error version.
I have also reinstall both NativeScript Preview and Playground from App Store and try again. This time, NativeScript Preview can only show the default app (i.e. the sample of each UI components) and the QR Code at the NativeScript Playground web site did not disappear (the checkbox did not checked).
When you have an exception on iOS you must not close the app. You should keep it opened and fix the issue or scan a new project. In the error message you can find "No need to close the app. Just fix following error and the app will sync automatically..."
Same here, tried it to keep it open, change code, nothing happens. Still referring to old code. It worked for a few times: change code > crash > change > preview. Then once the old stucked and can't clear out.
Reinstalled the playground app too, then it works (Project kept the same).
When the app was crashed:
- Did the app restarted after you apply the changes or it shows only the error ?
@vhristov5555 When it stucked (the changes no longer take effect) the preview didn't restarted.
Is the device shown in devices tab when this happens? To be hones I am not able to reproduce it and trying to understand the issue.
When the app has crashed the steps to fix it are:
open the preview (so you are able to see the error) fix the error while the app is opened(there is a message on the crash screen saying "No need to close the app. Just fix the following error and the app will sync automatically...") Make sure that the device is shown in the devices tab If you scan the QR code twice the app should work too. The opening of the app when it has crashed is always showing the error. After that you can fix it.
Tested a few things, and experienced the following: Using angular, sidekick, iphone (playground, preview):
- Write the following code
<Page>
<StackLayout orientation="vertical">
<Label text="This is Label 5"></Label>
</StackLayout>
</Page>
- Open up playground, scan qr code, opens in preview
- Change the label to
<Label text="This is Label 5"/> <!-- Notice the self closing -->In this scenario, the preview usually gives an error about cannot use selfclosing for labels. - Preview crashes, exit the app, gives error in sidekick
- Change the label line:
<Label text="This is Label 55555"></Label> <!-- Notice the text update --> - Rescan QR Code, preview opens and shows: This is label 5 (old version)
Solving this:
- Exit preview, rescan QR code, new label appears.
But in some cases, when the preview shows the error (not exiting) cannot clear it out. Simply change code or reload apps (playground and preview). Still the old error messages shows.
In the log this message also appeared - probably that's why the restart worked when preview crashed and exited also disappear from device list:
Cannot apply update. A previous update aborted. Application needs to be restarted in order to apply the changes. - this is ok.
The problem resolving currently in this case (show error, cannot update): to re-install preview AND playground too. Only one of them didn't solve the problem. After scanning, preview opens and show the actual page OR the error (but this is error is a new one, not the stucked).
Still testing it, reply if I know more
In case, when getting errors like this, only reinstall solves it: https://gist.github.com/iamzozo/d1e5c79bb18151fe66ae84ff0f07b8e7 https://gist.github.com/iamzozo/92445123551f4a1f5d33c82e7cd3f3d1
One of them happened, when:
- Copied a component folder (ts, html) contents to a new
- Renamed: ts, html, class. But not change the html reference in component class
- Gave fatal error, fixed, nothing happened
I repeated the same steps, but the error now is not fatal, only console shows there is "no such file".. fix, reload preview, works..
Could send us sample project? What template are you using? Could you send us cli version? Have try it only in Playground(https://play.nativescript.org)?
- https://drive.google.com/file/d/1dAPKEFNE7x1O7TtkJVcU0sGw_Pft8VLw/view?usp=sharing
- I'm using a blank template
- CLI and tns-ios version is 6.1.0
I haven't tried yet on the web.
What I have noticed, not all the time got fatal error, and can continue work. Sometimes can't. Tried to play with the code >preview > make error quickly > fix back >preview path, to check when the updated not finished send a new one. But didn't find an exact path to given issue.
Update: Restarted the apps, and got this error: https://drive.google.com/file/d/1P8Wiut5_S0SBG3hzY10TakN2J54F-_yT/view?usp=sharing
- Changed only text in html code to trigger build, preview still open and active
- Sidekick logged that code is rebuilt and synced -> nothing happened.
- After re-install both app, open in preview and the same code (linked project) worked.
I noticed whats wrong in the code. I meant, this message still appears when I change it.
I've experienced this a lot. Often more with template errors than with basic JavaScript errors.
Sometimes scanning a QR for a completely different app (on Playground) still will not flush out Preview. Guess I'd start with that case.
(As noted above, our Appalachian Ohio Internet is often very dicey. So, dropped connections may be a big part of the problem.)
Hi @iamzozo,
Thanks for the detailed steps and the sample app!
We were able to reproduce the issues and after a detailed investigation, I've opened a PR with a few tns preview related fixes. You can track the PR status and once it gets merged, the fixes will be available in nativescript@next. The official release will be in [email protected] in several weeks.
@EdJones, even with the current tns preview state, scanning the barcode once again should always fix the issues. Just ensure that the Preview App is currently opened on the device when you scan the barcode. In other words, you have to leave the preview app minimized (even if it's on a crash screen) and open the Playground app for another scan.
@DimitarTachev, thank you!
The behavior with scanning even a different barcode was fairly persistent. But, as I say, our Internet connection drops a lot. Thanks for digging in on this.
Yeah, I'm getting pretty tired of scanning that QR code ...
Can't do nothing about nativescript playground, it keep old "crash" unable to clean and track a new "preview". Very broken app!!!
This is really scary, I couldn't follow the tutorial on playground, am new to nativescript I like it at first but now, sidekick is not working many things are broken, I heard nStudio is taking over but no new announcements made about sidekick or playground...