Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

HMR not working when specify more than one export in file routing #2964

Closed
inithink opened this issue Dec 6, 2024 · 8 comments · Fixed by #2978
Closed

HMR not working when specify more than one export in file routing #2964

inithink opened this issue Dec 6, 2024 · 8 comments · Fixed by #2978

Comments

@inithink
Copy link

inithink commented Dec 6, 2024

Describe the bug

image
This document specifies why the problem occurs.
Currently, Hilla need export config for customizing routes.
But that disables HMR.

Expected-behavior

change <div>1</div> -> <div>2</div> should change 1 to 2 whit out refreshing the page

Reproduction

If I put the content in /src/main/frontend/views/test.tsx and change <div>1</div> -> <div>2</div>, HMR is not working.

import { ViewConfig } from '@vaadin/hilla-file-router/types.js';

export default function IndexView() {
  return (
    <div>1</div>
  )
}
export const config: ViewConfig = {
  menu: {
    order: 2,
    icon: 'line-awesome/svg/globe-solid.svg',
  },
  title: 'test',
};

System Info

Intel(R) Core(TM) i7-14700KF 3.40 GHz
Windows 11 Pro 24H2 26100.2314
Intellij with Jetbrain Runtime 17 + Vaadin Plugin

@inithink inithink added bug Something isn't working hilla Issues related to Hilla labels Dec 6, 2024
@Artur-
Copy link
Member

Artur- commented Dec 6, 2024

Tested this. Works fine, so there must be something else involved

@Legioth
Copy link
Member

Legioth commented Dec 6, 2024

The magic is here #2128

@inithink
Copy link
Author

inithink commented Dec 6, 2024

I just download new project from https://start.vaadin.com/ using options below
(with Hilla Empty page)
image
I commented dependencies below

<!--        <dependency>-->
<!--            <groupId>org.postgresql</groupId>-->
<!--            <artifactId>postgresql</artifactId>-->
<!--            <scope>runtime</scope>-->
<!--        </dependency>-->

<!--        <dependency>-->
<!--            <groupId>org.springframework.boot</groupId>-->
<!--            <artifactId>spring-boot-starter-data-jpa</artifactId>-->
<!--        </dependency>-->

Then I just start application, then change <h2>This place intentionally left empty</h2> to <h2>This place intentionally left empty1</h2> and HMR is not worked.
So I need to refresh the page.

What are the steps I need to take to find out about this problem?

@inithink
Copy link
Author

inithink commented Dec 6, 2024

I tested it in my my macbook.
It works well.
It seems it is windows specific problem.

@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Hilla 24.6.0.beta6 and is also targeting the upcoming stable 24.6.0 version.

@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Hilla 24.7.0.alpha3 and is also targeting the upcoming stable 24.7.0 version.

@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Hilla 24.5.9.

@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Hilla 24.4.19.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants