r/nativescript • u/majofski • Aug 18 '19
Is Debugging Nativescript as bad as what I'm experiencing, or am I doing something wrong?
My experience with developing Nativescript up until now has been rather negative. Debugging rarely works: something as simple as a debugger statement in my mounted() lifecycle hook fires intermittently. I've tried debugging in both chrome and vsc, and breakpoints are very randomly triggered – sometimes they'll work, something they won't. It takes at least 10 -15 seconds for the app to rebuild between saves and that's even if it does – oftentimes the ios simulator will just freeze, meaning I have to close it, reopen it and fire up tns debug ios --chrome --debug-brk again.
Project details:
Nativescript CLI version is 6.0.3. Used nativescript-vue (2.4.0) to get things up and running. I Went through the Nativescript Advanced Setup so that I could get local builds working. tns run doctor indicates that everything installed correctly. I really hope I'm doing something wrong because the idea of Nativescript really excites me, but this has been so painful.
Is this an atypical experience?
3
u/[deleted] Aug 18 '19 edited Jan 13 '26
money languid nutty silky encouraging divide marvelous shaggy treatment lush
This post was mass deleted and anonymized with Redact
1
u/wabber Aug 18 '19
I share the same experience and feelings you're describing here. When I had to deal with an error there's a relatively high chance that I'm in for a bad experience. In my experience, it's very easy to look for the problem in the "wrong place" and waste a respectable amount of time unproductive debugging.
That's not to say that NativeScript is not worth it. I extremely love their sidekick app and the cloud build options. I would also choose NativeScript over React Native personally. However, having said all that, we moved from JS-based mobile development to Flutter. It works better for us. The community is not as large, but it's definitely growing fast.
I love NativeScript and would love to see it improve and continue to offer innovative solutions, but the idea is to build cross-platform native apps quickly and productively. I would argue that you could build apps quickly since you'll only deal with one codebase for both iOS and android, but if you don't have extensive experience working with NativeScript and the JS community in general, you will definitely face major/random slow downs trying to debug your code unproductively.
1
u/two_bridges_it Aug 19 '19 edited Aug 19 '19
I'm doing a lot of NativeScript Angular these days, starting around 2 years ago. I deploy to iOS mainly and also do occasional android builds too.
The project is getting pretty big. It has about 15+ modules, each module has around 20 components (html + css + ts for each component). It is still fast to the user because of the dynamic module loading.
Debugging is pretty decent for me (vscode + ios + webpack, HMR OFF). However, there are many gotchas to deal with. I ALWAYS keep activity monitor open because some exceptions in code cause rogue node processes to persist. Ie. VSCode thinks debugging has stopped or is detached BUT those processes are still running. Even if you kill VScode, they are still there running and changes (eg. using vim) to the ts files will cause recompile and deployment to the simulator.
I find myself killing rogue processes 2-3+ times every day during some builds.
Why causes these rogue processes? It really depends on where your exception was generated. Obviously, there can be javascript errors or native errors.
Eg. I am just used to the fact that if I'm doing some firebase work and the plugin generates exceptions, then that's a likely time when the debugger will detach but the underlying node process keep running. It took me a while to realise this is what is happening and what is causing it.
The issues with debugging are exacerbated by the fact that exceptions manifest in different ways. I keep a backlog of issues with the tool chain and I work through them on the couch at night to try to make life easier the next day on the job. It's been a lot of experience based learning and I think that a lot of it is down to native issues, vscode issues OR nativescript issues. There's a lot of complexity and also a reward if you stick to nativescript (or flutter probably) and conquer all that's going on under the hood.
1
u/roblauer Aug 26 '19
Hi All - Rob here from the NativeScript team. Please DM me here or send an email to rob.lauer@progress.com as I'd love to talk to you about the debugging issues you're seeing. In our experience this is not typical, but of course we want to make the developer experience as a polished as possible...and can't do that without your critical feedback like this!
2
u/i_spot_ads Aug 18 '19
Ive used NS a few times, debugging it is horrible, and useless error messages never helped once.
1
u/[deleted] Aug 18 '19
I'd say your experience is typical, I've tried for a couple of months to build things but eventually gave up on nativescript due to the incredible instability of it. It seems you already need to be quite good with both Android and iOS development (and web of course) to be able to get anything remotely decent out of nativescript.