question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't build and run after upgrade from Vaadin 17.0.11 to 18.0.1

See original GitHub issue

Description of the bug / feature

Problems after updating from Vaadin 17.0.11 to 18.0.1

When starting in developement mode I get the following error:

2020-12-02 12:57:31.870 ERROR 22416 --- [nio-8080-exec-1] c.v.flow.server.frontend.FrontendUtils   : Cannot get the 'META-INF/VAADIN/index.html' from the classpath
2020-12-02 12:57:31.876 ERROR 22416 --- [nio-8080-exec-1] c.v.flow.server.DefaultErrorHandler      : 

java.io.UncheckedIOException: java.io.IOException: Failed to load content of './frontend/\/index.html'. It is required to have './frontend/\/index.html' file when using client side bootstrapping.

When building production image webpack throws the following error (starting Vaadin 18.0.x)

ERROR in ./styles/globalVariables.css
Module build failed (from ../node_modules/.pnpm/registry.npmjs.org/css-loader/4.2.1_webpack@4.42.0/node_modules/css-loader/dist/cjs.js):
Error: Can't resolve 'frontend/images/logo.svg' in 'D:\Workspace\webapp\frontend\styles'

Minimal reproducible example

My frontend folder looks like this:

frontent
- src
- styles
- index.html

In globalVariables.css I have the following line:

--logoImage: url("frontend/images/logo.svg");

The logo is located in: webapp\src\main\resources\static\images\logo.svg

Expected behavior

No problem when running/building image

Actual behavior

Error when running/building image

Versions:

- Vaadin / Flow version: 18.0.1
- Java version: 11
- OS version: Windows 10
- Spring Boot: 2.4.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
plekucommented, Dec 3, 2020

Thanks for the report - the untested workaround would be to add the following inside webpack.config.js before the line module.exports = merge(flowDefaults,:

const cssLoaders = flowDefaults.module.rules.find(r => r.test && r.test.toString() == '/\\.css$/i');
const index = cssLoaders.use.indexOf('css-loader');
if (index !== -1) {
  const cssLoaderConfig = {
    loader: 'css-loader',
    options: { url: false }
  };
  cssLoaders.use.splice(index, 1, cssLoaderConfig);
}

we’ll land a fix for this soon that makes css-loader touch only node_modules urls.

0reactions
plekucommented, Dec 9, 2020

This has been fixed in 5.0.2 / 18.0.2

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't build and run after upgrade from Vaadin 17.0.11 to 18.0.1
Problems after updating from Vaadin 17.0.11 to 18.0.1. When starting in developement mode I get the following error:
Read more >
Vaadin 14 to 23 Upgrade Instructions
This is a list of the changes you need to make in your application when upgrading it from Vaadin 14 to Vaadin 23,...
Read more >
Upgrading | Vaadin Docs
Show sub-pages of Step-by-step guide. Step-by-step guide · Importing to an IDE · Running an Application. Show sub-pages of Tutorial
Read more >
Cant' build maven Base Starter project for Vaadin Flow
Hi, after downloading the zip and importing it (eclipse oxygen) as a maven project, I can't even compile. I get two errors :...
Read more >
Build fails after upgrading from Vaadin 7 8
JavaCommand.execute(JavaCommand.java:330) at com.vaadin.integration.maven.CompileThemeMojo.processTheme(CompileThemeMojo.java:65) at ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found