Open mvysny opened 5 years ago
I couldn't reproduce this on a clean base starter + idea + tomcat 9.0.20
[RMI TCP Connection(3)-127.0.0.1] INFO dev-updater - package.json updated and npm dependencies installed.
[RMI TCP Connection(3)-127.0.0.1] INFO dev-updater - Copying frontend resources from jar files ...
[RMI TCP Connection(3)-127.0.0.1] INFO dev-updater - Visited 10 jar files. Took 182 ms.
[RMI TCP Connection(3)-127.0.0.1] INFO dev-updater - Updated C:\Users\mikae\Code\skeleton-starter-flow\target\frontend\generated-flow-imports.js
What do you have in the local Tomcat launch configuration
?
Also the only change in 14.0.1 is that we handle correctly paths with special characters like space (%20
) in the url names.
Also you seem to be running an older node (even if this doesn't matter for the jar scanning)
npm WARN npm npm does not support Node.js v10.15.2
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
I am also using Tomcat 9.0.20 :+1:
In my Tomcat Run configuration, in the Deployment tab, I've had the project-base:war exploded
artifact. When I replaced it with just project-base:war
it indeed started to work. When I reverted back to project-base:war exploded
artifact, the server still started but it printed Visited 0 jar files. Took 1 ms.
; so when I deleted the node_modules
folder and restarted Tomcat, it again failed with Can't resolve '@vaadin/flow-frontend/flow-component-renderer.js'
TL;DR: Vaadin 14.0.1+IDEA+Tomcat combo does not seem to work when you select the 'exploded' artifact, however Vaadin 14.0.0 works properly even with 'exploded' artifact.
I had it working fine with both war and exploded war.
Hmm, I'm running Linux x86-64 on Java 8, I wonder if it is some kind of Linux issue, or just my local dev env issue... Let me try on a different machine with Linux.
Actually, on the same machine when the project is located in /home/mavi/temp/skeleton-starter-flow/
then it starts properly; when it's located in /home/mavi/work/vaadin/starters-10+/skeleton-starter-flow/
it doesn't start. I wonder if the +
character in the path name could break things...
I have the same problem running on wildfly (tried it on 12.0.0, 15.0.1 and 17.0.1). My steps to reproduce:
web.xml
with one context-param: compatibilityMode
with value false
mvn package
(actually only running (EDIT2) mvn compile is enough - we need flow-build-info.json
along with other files in META-INF)After some digging it seems that those JARs that should be visited do not have the compliant path for regex in DevModeInitializer#JAR_FILE_REGEX
).
Example:
One of the JARs with frontend resources is flow-data-2.0.8.jar
. The URLDecoder decodes the path to /C:/path-to-project-source/starter-simple-app/starter-simple-app-ui/target/starter-simple-app-ui-1.0-SNAPSHOT/WEB-INF/lib/flow-data-2.0.8.jar/META-INF/resources/frontend/
, which is not compliant with the regex, which says that the path should contain file:/
and .jar
.
Even more, if I add another module in a multi-module project to this starter which also has frontend dependencies in src/main/resources/META-INF/resources/frontend
, it also does not get scanned.
I actually dug around some and found that the multi-module problem is already handled in #6242 (but sadly it only exists in a feature branch for now, not in master branch). If I download that branch with those fixes and modify the additional regex some more to allow trailing /, everything starts to work as it should.
Wildfly has another problem which is in ticket https://github.com/vaadin/flow/issues/6245 as it uses vfs:/ instead of file:/
This comment says that home/mavi/temp/skeleton-starter-flow/
path works .
Looks like the problem is only with special paths like /home/mavi/work/vaadin/starters-10+/skeleton-starter-flow/
.
Steps to reproduce:
Workaround: downgrade to Vaadin 14.0.0. The jar files are now correctly auto-discovered and the app starts: