Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Vaadin fails to start from version 24.3.8 to 24.6.2 #20931

Open
jorgexbermudez opened this issue Jan 29, 2025 · 5 comments
Open

Vaadin fails to start from version 24.3.8 to 24.6.2 #20931

jorgexbermudez opened this issue Jan 29, 2025 · 5 comments

Comments

@jorgexbermudez
Copy link

jorgexbermudez commented Jan 29, 2025

Description of the bug

My application runs in 24.3.8, I want to update to implement new features,

When changing the version and running it I get the following error on building the frontend:

`2025-01-29T15:59:48.058+01:00 ERROR 20252 --- [nio-8080-exec-8] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] thr
ew exception [com.vaadin.flow.server.ServiceException: java.lang.IllegalStateException:

Failed to find the following css files in the node_modules or myproject\src\main\frontend directory tree:
- ./styles/vaadin-checkbox.css
Check that they exist or are installed. If you use a custom directory for your resource files instead of the default frontend folder then make sure it's correctly configured (e.g.
set 'vaadin.frontend.frontend.folder' property)

] with root cause

java.lang.IllegalStateException:

Failed to find the following css files in the node_modules or myproject\src\main\frontend directory tree:
- ./styles/vaadin-checkbox.css
Check that they exist or are installed. If you use a custom directory for your resource files instead of the default frontend folder then make sure it's correctly configured (e.g.
set 'vaadin.frontend.frontend.folder' property)

    at com.vaadin.flow.server.frontend.AbstractUpdateImports.getCssLines(AbstractUpdateImports.java:502) ~[flow-server-24.6.2.jar!/:24.6.2]
    at com.vaadin.flow.server.frontend.AbstractUpdateImports.process(AbstractUpdateImports.java:376) ~[flow-server-24.6.2.jar!/:24.6.2]
    at com.vaadin.flow.server.frontend.AbstractUpdateImports.run(AbstractUpdateImports.java:161) ~[flow-server-24.6.2.jar!/:24.6.2]
    at com.vaadin.flow.server.frontend.TaskUpdateImports.execute(TaskUpdateImports.java:80) ~[flow-server-24.6.2.jar!/:24.6.2]
    at com.vaadin.flow.server.frontend.NodeTasks.execute(NodeTasks.java:347) ~[flow-server-24.6.2.jar!/:24.6.2]
    at com.vaadin.base.devserver.startup.DevModeInitializer.runNodeTasks(DevModeInitializer.java:369) ~[vaadin-dev-server-24.6.2.jar!/:na]
    at com.vaadin.base.devserver.startup.DevModeInitializer.lambda$initDevModeHandler$0(DevModeInitializer.java:303) ~[vaadin-dev-server-24.6.2.jar!/:na]
    at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) ~[na:na]
    at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) ~[na:na]
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[na:na]
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[na:na]
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[na:na]
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[na:na]
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[na:na]

`

I see that the types.d.ts was updated from:
declare module '*.css' { import { CSSResultGroup } from 'lit'; const content: CSSResultGroup; export default content; }

to:

declare module '*.css?inline' {
  import type { CSSResultGroup } from 'lit';
  const content: CSSResultGroup;
  export default content;
}

// Allow any CSS Custom Properties
declare module 'csstype' {
  interface Properties {
    [index: `--${string}`]: any;
  }
}

I run it by doing a mvn clean install and then run the jar. So it is running a jar on development mode.
So might be related to the question here: #18611
(This is run like this because otherwise the command name is too long and I cannot run it locally)

I also not requesting any css for the vaadin-checkbox. I use the Checkbox component but the css stylying request is being done by other process.

Expected behavior

The application runs as expected.

Minimal reproducible example

Versions

  • Vaadin / Flow version: 24.3.8->24.6.2
  • Java version: 17
  • OS version:Windows 10
  • Browser version (if applicable):
  • Application Server (if applicable):
  • IDE (if applicable):
@mcollovati
Copy link
Collaborator

Did you try to run mvn vaadin:clean-frontend and then package the application again?

@jorgexbermudez
Copy link
Author

@mcollovati yes, and I am getting the same behaviour

@mcollovati
Copy link
Collaborator

It could be related to the issue you linked.
However, I'd like to understand who is referencing the vaadin-checkbox.css stylesheet.
Is your project using some community add-ons?

@mcollovati
Copy link
Collaborator

mcollovati commented Feb 3, 2025

BTW, may I ask you why do you want to run the app in development mode from the command line instead of launching from the IDE?

Also, if it is a Spring Boot base project, you can run mvn spring-boot:run to launch the app in DEV mode from the command line.
Or mvn compile exec:java -Dexec.mainClass=org.vaadin.example.Application, if you want to prevent Spring Boot repackaging.

@mcollovati
Copy link
Collaborator

The vaadin-checkbox.css reference could be from Togglebutton for Flow add-on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🆕 Needs triage
Development

No branches or pull requests

3 participants