vaadin / hilla

Build better business applications, faster. No more juggling REST endpoints or deciphering GraphQL queries. Hilla seamlessly connects Spring Boot and React to accelerate application development.
https://hilla.dev
Apache License 2.0
899 stars 56 forks source link

Frontend generated files suddenly stopped updating or generating new browser callable class. #1964

Closed cvmabilin closed 8 months ago

cvmabilin commented 8 months ago

Describe the bug

I was trying to create a class BrowserCallable that should be generated in the frontend generated file but it seems not working or updating. The class is not generated in the said frontend.

Please let me know if I am missing something.

I am using the latest version of hilla (2.5.5)

Expected-behavior

No response

Reproduction

Screenshot 2024-01-16 at 11 30 00 AM

The screenshot above shows the generated files in the frontend directory, it seems like the new class AccountServiceCallable which is browserCallable are not generated in the frontend.

I have tried to re-run the project multiple times and deleting the generated folder in the frontend but it still generating the same files without the new class which has a browserCallable.

The image below shows where the AccountServiceCallable is stored.

Screenshot 2024-01-16 at 11 32 54 AM

System Info

MacOS

<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0
<!-- Project from https://start.vaadin.com/project/06fd8a9a-e314-4743-9a01-9aea10f54bcd -->
<groupId>com.example.application</groupId>
<artifactId>web-app-template</artifactId>
<name>web-app-template</name>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<properties>
    <java.version>17</java.version>
    <hilla.version>2.5.5</hilla.version>
</properties>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.2.0</version>
</parent>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>dev.hilla</groupId>
            <artifactId>hilla-bom</artifactId>
            <version>${hilla.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    <dependency>
        <groupId>dev.hilla</groupId>
        <artifactId>hilla-react</artifactId>
    </dependency>
    <dependency>
        <groupId>dev.hilla</groupId>
        <artifactId>hilla-spring-boot-starter</artifactId>
    </dependency>
    <dependency>
        <groupId>org.parttio</groupId>
        <artifactId>line-awesome</artifactId>
        <version>2.0.0</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-validation</artifactId>
    </dependency>

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

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

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-oauth2-jose</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-oauth2-resource-server</artifactId>
    </dependency>

    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <optional>true</optional>
    </dependency>

    <dependency>
        <groupId>com.corundumstudio.socketio</groupId>
        <artifactId>netty-socketio</artifactId>
        <version>2.0.3</version>
    </dependency>

</dependencies>

<build>
    <defaultGoal>spring-boot:run</defaultGoal>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <jvmArguments>-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5247</jvmArguments>
                <wait>500</wait>
                <maxAttempts>240</maxAttempts>
            </configuration>
        </plugin>

        <plugin>
            <groupId>dev.hilla</groupId>
            <artifactId>hilla-maven-plugin</artifactId>
            <version>${hilla.version}</version>
            <executions>
                <execution>
                    <goals>
                        <goal>prepare-frontend</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

<profiles>
    <profile>
        <!-- Production mode is activated using -Pproduction -->
        <id>production</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>dev.hilla</groupId>
                    <artifactId>hilla-maven-plugin</artifactId>
                    <version>${hilla.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>build-frontend</goal>
                            </goals>
                            <phase>compile</phase>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>

cvmabilin commented 8 months ago

I was able to fix the issue by deleting the generated folder, node_modules, updating the version of hilla from 2.5.5 to 2.5.6 then re-run again the application.

I am still not sure what is the problem at the time that the browser callable is not generating when i was using 2.5.5 version.