Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Vue app crashes after sync changes in styles #943

Closed
endarova opened this issue Jun 20, 2019 · 4 comments · Fixed by nativescript-vue/nativescript-vue#512 or nativescript-vue/nativescript-vue#517
Assignees
Labels

Comments

@endarova
Copy link
Contributor

Environment

  • CLI: next(6.0)
  • Cross-platform modules:6.0.0-next-2019-06-17-201500-04
  • Android Runtime:6.0.0-2019-06-13-112614-01
  • iOS Runtime:6.0.0-2019-06-13-141312-01
  • Plugin(s):[email protected]

Describe the bug
When making changes in styles section of Home.vue file app crashes

To Reproduce

  1. tns create TestApp --vue
  2. npm i tns-core-modules@next --save
  3. npm i nativescript-dev-webpack@next --save-dev
  4. node_modules/.bin/update-ns-webpack --deps --configs
  5. npm i NativeScript-vue@next
    6 .tns platform add ios@next
  6. tns run iOS
  7. In Home.vue in style section in .info style (line39), add color:red;

Expected behavior
Project is synced and style is applied.

Actual
Project is synced but crashes. Log:
log_file.txt

Additional context
Make exactly that change in the file

@vchimev
Copy link
Contributor

vchimev commented Jul 1, 2019

Hey!

This issue is caused by a change in the nativescript-vue plugin.

In version 2.3.0-rc.0, the global.__onLiveSyncCore overwrite function requires the tns-core-modules/application module which contains the global.__onLiveSyncCore logic itself.
As a result, the overwrite function doesn't serve its purpose.

A solution could be to require the tns-core-modules/application module in the global scope here.

@rigor789 and @vakrilov, what are your opinions?

@vakrilov
Copy link
Contributor

vakrilov commented Jul 1, 2019

Sounds like an easy fix.
We have a similar case in nativescript-angular package and we make sure we require polyfills and application first.

rigor789 pushed a commit to nativescript-vue/nativescript-vue that referenced this issue Jul 1, 2019
Ensure `application` module is loaded before overriding `global.__onLiveSyncCore`.

Fixes NativeScript/nativescript-dev-webpack#943.
@endarova
Copy link
Contributor Author

endarova commented Jul 2, 2019

I can confirm the issue is resolved in nativescript-vue@next

@endarova
Copy link
Contributor Author

endarova commented Jul 3, 2019

Actually the issue for iOS is fixed but now when I make the same change for android the app crashes again. Here is the log
log.txt

rigor789 pushed a commit to nativescript-vue/nativescript-vue that referenced this issue Jul 3, 2019
Ensure `frame` module is loaded before overriding `global.__onLiveSyncCore` for Android.

Fixes NativeScript/nativescript-dev-webpack#943 for Android.
@endarova endarova closed this as completed Jul 5, 2019
etherdog-eth pushed a commit to etherdog-eth/nativescript-vue that referenced this issue May 31, 2021
Ensure `application` module is loaded before overriding `global.__onLiveSyncCore`.

Fixes NativeScript/nativescript-dev-webpack#943.
etherdog-eth pushed a commit to etherdog-eth/nativescript-vue that referenced this issue May 31, 2021
Ensure `frame` module is loaded before overriding `global.__onLiveSyncCore` for Android.

Fixes NativeScript/nativescript-dev-webpack#943 for Android.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants