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 create test --template @nativescript-vue/template-blank@latest
- Create the file
./src/pages/auth/sign-in.vue
with this content:
<template>
<Page actionBarHidden="true">
<StackLayout class="p-4 bg-slate-50">
<Button
text="Back"
@tap="$navigateBack()"
/>
<Label text="Sign In" />
</StackLayout>
</Page>
</template>
- Create the file
./src/pages/Home.vue
with this content:
<template>
<Frame>
<Page actionBarHidden="true">
<StackLayout>
<Button
text="Sign In"
@tap="$navigateTo(SignIn)"
/>
</StackLayout>
</Page>
</Frame>
</template>
<script lang="ts" setup>
import SignIn from "./auth/sign-in.vue";
</script>
- Make sure Home.vue is the root component used in app.ts.
import { createApp } from 'nativescript-vue';
import Home from './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