question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error with --HMR option in Nativescript-Vue 2.2.0

See original GitHub issue

Version

2.2.0

Reproduction link

https://github.com/hoatructhanhlam/bug-hmr-nativescript-vue

Platform and OS info

Android 7.0

Steps to reproduce

tns run android --hmr

What is expected?

After the launch, the page transfer application is normal with this.$navigateTo(Template) But after app rerender with --hmr option, if redirect to new page, will get exception

What is actually happening?

System.err: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
System.err: 	at android.view.ViewGroup.addViewInner(ViewGroup.java:5161)
System.err: 	at android.view.ViewGroup.addView(ViewGroup.java:4991)
System.err: 	at android.view.ViewGroup.addView(ViewGroup.java:4931)
System.err: 	at android.view.ViewGroup.addView(ViewGroup.java:4904)
System.err: 	at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1427)
System.err: 	at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1752)
System.err: 	at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1821)
System.err: 	at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:797)
System.err: 	at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2595)
System.err: 	at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2382)
System.err: 	at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2337)
System.err: 	at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2244)
System.err: 	at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:702)
System.err: 	at android.os.Handler.handleCallback(Handler.java:790)
System.err: 	at android.os.Handler.dispatchMessage(Handler.java:99)
System.err: 	at android.os.Looper.loop(Looper.java:164)
System.err: 	at android.app.ActivityThread.main(ActivityThread.java:7000)
System.err: 	at java.lang.reflect.Method.invoke(Native Method)
System.err: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
System.err: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)

P/S: Before that (v2.0.2), it still works great

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
msaelicescommented, Mar 25, 2019

@hoatructhanhlam until a new version was released you can check it by doing this:

  1. Clone the nativescript-vue repo. Run npm install && npm run build inside it.
  2. Change the nativescript-vue dependency in your app’s package.json to "nativescript-vue": "file://path/to/nativescript-vue"
  3. In your app, remove your current node_modules/nativescript-vue directory and run npm install again. You should have a symbolic link to the git version.
  4. Run tns run android --hmr
1reaction
msaelicescommented, Apr 4, 2019

@hoatructhanhlam good news! @rigor789 just released a new 2.2.1 version which includes my fix. I’ve just tested it with your repo (changing your package.json dependency to ^2.2.1) and it works.

I will close the issue. Please re-open if there is something I missed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HMR with typescript template · Issue #518 · nativescript-vue ...
Steps to reproduce. Install typescript version. Run npm run android --hmr . Edit the 'msg' value in the App.vue file.
Read more >
Nativescript-vue + Typescript - HMR not working on Vue Class ...
When saving any file with vue class component style + typescript, It simply does not update. Give me the following error: File change...
Read more >
NativeScript 7.1 - HMR Reenabled and Xcode 12.3 Support
HMR (Hot Module Replacement) is a feature that was introduced in NativeScript 5.3. With NativeScript 7 all @nativescript/webpack dependencies ...
Read more >
Source - GitHub
[8.3.3](https://github.com/NativeScript/nativescript-cli/compare/v8.3.2...v8.3.3 ... vue-ts-template ... (2020-06-27) ### Bug Fixes * **react:** tns options ...
Read more >
NativeScript HMR is Here - and It's On by Default! - YouTube
In this video, I take it for a test drive in NativeScript Core, NativeScript Angular, and NativeScript Vue, and see how the developer ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found