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

Unclear issue when missing vaadin-dev-server #225

Open
caalador opened this issue Oct 5, 2021 · 0 comments
Open

Unclear issue when missing vaadin-dev-server #225

caalador opened this issue Oct 5, 2021 · 0 comments
Labels

Comments

@caalador
Copy link
Contributor

caalador commented Oct 5, 2021

When executing a project in development mode without the vaadin-dev-server dependency the issue seems like the project was missing the index.html in ./frontend as the warning about no DevModeHandlerManager gets lost in the logs that is logged after accessing the page.

[qtp1332823688-32] INFO com.vaadin.flow.server.DefaultDeploymentConfiguration -
Vaadin is running in DEBUG MODE.
When deploying application for production, remember to disable debug features. See more from https://vaadin.com/docs/
Using Vaadin 15+ bootstrap mode.
 Using 'index.html' from 'C:\...\flow\flow-tests\test-themes\frontend\index.html'
 Using 'index.ts' from 'C:\...\flow\flow-tests\test-themes\frontend\index.ts'
[qtp1332823688-32] WARN com.vaadin.flow.server.VaadinServletService - no DevModeHandlerManager implementation found but dev server enabled. Include the com.vaadin.vaadin-dev-server dependency.
[qtp1332823688-32] ERROR com.vaadin.flow.server.frontend.FrontendUtils - Cannot get the 'index.html' from the classpath
[qtp1332823688-32] ERROR com.vaadin.flow.server.DefaultErrorHandler -
java.io.IOException: Failed to load content of 'C:\...\flow\flow-tests\test-themes\frontend\index.html'. It is required to have 'C:\...\flow\flow-tests\test-themes\frontend\index.html' file when using client side bootstrapping.
        at com.vaadin.flow.server.communication.IndexHtmlRequestHandler.getIndexHtmlDocument(IndexHtmlRequestHandler.java:292)
        at com.vaadin.flow.server.communication.IndexHtmlRequestHandler.synchronizedHandleRequest(IndexHtmlRequestHandler.java:89)
        at com.vaadin.flow.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)
        at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1565)
        at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:302)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1450)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
        at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1626)
        at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:228)
        at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
        at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:602)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:191)
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
        at org.eclipse.jetty.server.Server.handle(Server.java:516)
        at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:388)
        at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:633)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:380)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
        at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
        at java.lang.Thread.run(Thread.java:748)
[WARNING] handleException /path/com.vaadin.flow.uitest.ui.theme.ThemeView java.io.IOException: Failed to load content of 'C:\...\flow\flow-tests\test-themes\frontend\index.html'. It is required to have 'C:\...\flow\flow-tests\test-themes
\frontend\index.html' file when using client side bootstrapping.

Also the page only shows the exception of missing index.html:

<html>
<body>
<!--StartFragment--><h2 style="color: rgb(0, 0, 0); font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">HTTP ERROR 500 javax.servlet.ServletException: javax.servlet.ServletException: com.vaadin.flow.server.ServiceException: java.io.IOException: Failed to load content of 'C:\...\flow\flow-tests\test-themes\frontend\index.html'. It is required to have 'C:\...\flow\flow-tests\test-themes\frontend\index.html' file when using client side bootstrapping.</h2>

URI: | /path/com.vaadin.flow.uitest.ui.theme.ThemeView
-- | --
500
javax.servlet.ServletException: javax.servlet.ServletException: com.vaadin.flow.server.ServiceException: java.io.IOException: Failed to load content of 'C:\...\flow\flow-tests\test-themes\frontend\index.html'. It is required to have 'C:\...\flow\flow-tests\test-themes\frontend\index.html' file when using client side bootstrapping.
com.vaadin.flow.uitest.ui.servlets.WorkaroundServlet
javax.servlet.ServletException: javax.servlet.ServletException: com.vaadin.flow.server.ServiceException: java.io.IOException: Failed to load content of 'C:\...\flow\flow-tests\test-themes\frontend\index.html'. It is required to have 'C:\...\flow\flow-tests\test-themes\frontend\index.html' file when using client side bootstrapping.
javax.servlet.ServletException: com.vaadin.flow.server.ServiceException: java.io.IOException: Failed to load content of 'C:\...\flow\flow-tests\test-themes\frontend\index.html'. It is required to have 'C:\...\flow\flow-tests\test-themes\frontend\index.html' file when using client side bootstrapping.
com.vaadin.flow.server.ServiceException: java.io.IOException: Failed to load content of 'C:\...\flow\flow-tests\test-themes\frontend\index.html'. It is required to have 'C:\...\flow\flow-tests\test-themes\frontend\index.html' file when using client side bootstrapping.
java.io.IOException: Failed to load content of 'C:\...\flow\flow-tests\test-themes\frontend\index.html'. It is required to have 'C:\...\flow\flow-tests\test-themes\frontend\index.html' file when using client side bootstrapping.

<h3 style="color: rgb(0, 0, 0); font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Caused by:</h3><pre style="color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">javax.servlet.ServletException: javax.servlet.ServletException: com.vaadin.flow.server.ServiceException: java.io.IOException: Failed to load content of 'C:\...\flow\flow-tests\test-themes\frontend\index.html'. It is required to have 'C:\...\flow\flow-tests\test-themes\frontend\index.html' file when using client side bootstrapping.
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:162)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)</pre><!--EndFragment-->
</body>
</html>

Minimal reproducible example

In the flow project test module test-themes (<artifactId>flow-test-themes-npm</artifactId>, <name>Flow themes tests in NPM mode</name>) remove from the flow-maven-plugin the build-frontend goal and productionMode configuration.

run project with mvn package jetty:run

Expected behavior

Error shown on load should mention vaadin-dev-server dependency. Or at a minimum explain that webpack-dev-server did not return index.html when queried. Instead of referencing a file on disk that was not even tried.

Actual behavior

Error references a file that actually exists on the filesystem making the error not make any sense at all.

@caalador caalador added DX hilla Issues related to Hilla labels Oct 5, 2021
@vaadin-bot vaadin-bot transferred this issue from vaadin/flow Mar 4, 2022
Artur- added a commit to vaadin/flow that referenced this issue Nov 22, 2022
…not using a dev server

While this does not directly solve any issue it will make vaadin/hilla#225 clearer when there is no longer any error about a missing index.html but instead you see in the logs:

[qtp1200171710-60] INFO com.vaadin.flow.server.DefaultDeploymentConfiguration -
Vaadin is running in DEVELOPMENT mode - do not use for production deployments.
[qtp1200171710-60] WARN com.vaadin.flow.server.VaadinServletService - no DevModeHandlerManager implementation found but dev server enabled. Include the com.vaadin.vaadin-dev-server dependency.
Artur- added a commit to vaadin/flow that referenced this issue Nov 22, 2022
…not using a dev server

While this does not directly solve any issue it will make vaadin/hilla#225 clearer when there is no longer any error about a missing index.html but instead you see in the logs:

[qtp1200171710-60] INFO com.vaadin.flow.server.DefaultDeploymentConfiguration -
Vaadin is running in DEVELOPMENT mode - do not use for production deployments.
[qtp1200171710-60] WARN com.vaadin.flow.server.VaadinServletService - no DevModeHandlerManager implementation found but dev server enabled. Include the com.vaadin.vaadin-dev-server dependency.
Artur- added a commit to vaadin/flow that referenced this issue Nov 22, 2022
…not using a dev server

While this does not directly solve any issue it will make vaadin/hilla#225 clearer when there is no longer any error about a missing index.html but instead you see in the logs:

[qtp1200171710-60] INFO com.vaadin.flow.server.DefaultDeploymentConfiguration -
Vaadin is running in DEVELOPMENT mode - do not use for production deployments.
[qtp1200171710-60] WARN com.vaadin.flow.server.VaadinServletService - no DevModeHandlerManager implementation found but dev server enabled. Include the com.vaadin.vaadin-dev-server dependency.
Artur- added a commit to vaadin/flow that referenced this issue Nov 22, 2022
…not using a dev server

While this does not directly solve any issue it will make vaadin/hilla#225 clearer when there is no longer any error about a missing index.html but instead you see in the logs:

[qtp1200171710-60] INFO com.vaadin.flow.server.DefaultDeploymentConfiguration -
Vaadin is running in DEVELOPMENT mode - do not use for production deployments.
[qtp1200171710-60] WARN com.vaadin.flow.server.VaadinServletService - no DevModeHandlerManager implementation found but dev server enabled. Include the com.vaadin.vaadin-dev-server dependency.
Artur- added a commit to vaadin/flow that referenced this issue Nov 23, 2022
…not using a dev server

While this does not directly solve any issue it will make vaadin/hilla#225 clearer when there is no longer any error about a missing index.html but instead you see in the logs:

[qtp1200171710-60] INFO com.vaadin.flow.server.DefaultDeploymentConfiguration -
Vaadin is running in DEVELOPMENT mode - do not use for production deployments.
[qtp1200171710-60] WARN com.vaadin.flow.server.VaadinServletService - no DevModeHandlerManager implementation found but dev server enabled. Include the com.vaadin.vaadin-dev-server dependency.
Artur- added a commit to vaadin/flow that referenced this issue Nov 25, 2022
…not using a dev server

While this does not directly solve any issue it will make vaadin/hilla#225 clearer when there is no longer any error about a missing index.html but instead you see in the logs:

[qtp1200171710-60] INFO com.vaadin.flow.server.DefaultDeploymentConfiguration -
Vaadin is running in DEVELOPMENT mode - do not use for production deployments.
[qtp1200171710-60] WARN com.vaadin.flow.server.VaadinServletService - no DevModeHandlerManager implementation found but dev server enabled. Include the com.vaadin.vaadin-dev-server dependency.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants