Failed to find the following css files in the `node_modules` or `/fronten

I’m trying to migrate to Vaadin 14 NPM. If i don’t import any files everything works. As soon as i try to import any css it stops working.

(I am using spring boot WITHOUT the maven plugin)

  Failed to find the following css files in the `node_modules` or `/frontend` tree:
      - ./styles/dashboard.css
  Check that they exist or are installed.
@CssImport("./styles/dashboard.css")
@Theme(value = Material.class, variant = Material.DARK)
public class MainLayout extends Div implements ....

Here is my project folder structure

In Spring boot you normally put your resource files into META-INF/resources/frontend folder inside your resource root.
You have src folder inside frontend . Does it contain any files (and are they discovered by the build)?

Denis Anisimov:
You have src folder inside frontend . Does it contain any files (and are they discovered by the build)?

Yes the src folder inside frontend contains files, but they are also not discovered:

@JavaScript("./src/scripts/navigation.js")
  Failed to resolve the following files either:
   · in the `/frontend` sources folder
   · or as a `META-INF/resources/frontend` resource in some JAR.
      - ./src/scripts/navigation.js
  Please, double check that those files exist.

Denis Anisimov:
In Spring boot you normally put your resource files into META-INF/resources/frontend folder inside your resource root.

How should the file structure look like,
webapp > src > main > resources > META-INF > resources > frontend ?

Then the following error appears:

  Failed to find the following imports in the `node_modules` tree:
      - @vaadin/flow-frontend/src/scripts/navigation.js
  If the build fails, check that npm packages are installed.

{project-root} > src > main > resources > META-INF > resources > frontend > src > scripts > navigation.js

No,
if you are using Spring boot then it’s
src/main/resources/META-INF/resources/frontend.

Sadly this also did not work:

  Failed to find the following imports in the `node_modules` tree:
      - @vaadin/flow-frontend/src/scripts/navigation.js
  If the build fails, check that npm packages are installed.

Oh, my bad.
frontend folder inside the project root should work for Spring boot project as well.
So your initial config should work.
Looks like a bug. Could you pleases create a ticket ?

Here is the Github Issue Link:

[https://github.com/vaadin/flow/issues/6411]
(https://github.com/vaadin/flow/issues/6411)

For anyone else having the same problem:

Because of my multi module project i had to relocate the frontend folder to:

<main-project-folder>\frontend

instead of

<main-project-folder>\<vaadin-app>\frontend

Also use the newest Vaadin Version 14.03.
The better error message from 14.0.3 helped a lot.