Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork245
Open
Description
HMR (Hot Module Replacement) is only working when changes are made to the component that is directly set in app.ts. If I navigate to another screen (e.g., using $navigateTo()), and make edits to that screen’s file, changes are not reflected unless I manually edit the initial screen to force a reload.
🔁 Steps to reproduce
- Create a new project:
ns createtest --template @nativescript-vue/template-blank@latest
- Create the file
./src/pages/auth/sign-in.vue
with this content:
<template> <PageactionBarHidden="true"> <StackLayoutclass="p-4 bg-slate-50"> <Buttontext="Back"@tap="$navigateBack()" /> <Labeltext="Sign In" /> </StackLayout> </Page></template>
- Create the file
./src/pages/Home.vue
with this content:
<template> <Frame> <PageactionBarHidden="true"> <StackLayout> <Buttontext="Sign In"@tap="$navigateTo(SignIn)" /> </StackLayout> </Page> </Frame></template><script lang="ts" setup>importSignInfrom"./auth/sign-in.vue";</script>
- Make sure Home.vue is the root component used in app.ts.
import{createApp}from'nativescript-vue';importHomefrom'./pages/Home.vue';createApp(Home).start();
✅ How to test
- Run the app
- Tap the Sign In button to navigate to the sign-in.vue screen
- While staying on the SignIn screen, make any change in sign-in.vue (e.g., text, layout, etc.)
- Nothing happens.
- Now, edit Home.vue (e.g., add a space) — the app reloads and goes back to the initial screen
- Navigate to Sign In again — you’ll now see the updated version
💻 My environment
- macOS Sequoia 15.5 (M2 Pro)
- Happens on both iOS and Android
- NativeScript Vue 3 with $navigateTo() +
🔧 Expected behavior
HMR should reflect changes in any active screen component, regardless of whether it is the initial component set in app.ts.
Metadata
Metadata
Assignees
Labels
No labels