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.

[vite] The offline path is requested regardless of the original path when online in dev mode

See original GitHub issue

Description of the bug

The service worker always requests the offline path in dev mode even if the original request path is different. Although this makes sense when the app is offline, it is absolutely incorrect when the app is online.

The related code fragment:

https://github.com/vaadin/flow/blob/1bc5ff8606942cf611ed612f2f8a7bff2adc23a8/flow-server/src/main/resources/com/vaadin/flow/server/frontend/sw.ts#L92-L101

Expected behavior

When the app is online, the service worker should not modify HTTP requests.

When the app is offline, the service worker should redirect HTTP requests to the offline path.

Minimal reproducible example

  1. Clone https://github.com/vaadin/cookbook
  2. Run mvn
  3. Open http://localhost:8080/css-from-java

Expected:

<meta name="description" content="This recipe shows how to inject small CSS class definitions into the current page from Java.">

Actual:

<meta name="description" content="Find ready to use solutions and code snippets for common development problems and UX patterns. Includes Vaadin examples in Java and TypeScript.">

Versions

  • Vaadin / Flow version: 23
  • Java version: 17
  • OS version: Mac OS

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
taeficommented, Jul 6, 2022

Thanks! That’s correct, I misunderstood it. It always adds the <meta> tag with the value for the root.

1reaction
Artur-commented, Jul 5, 2022

You should see it when you have the server running, http://localhost:8080/css-from-java open and press refresh in the browser

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting - Vite
Switch to another package manager (e.g. pnpm , yarn ); Remove & from the path to your project. Dev Server #. Requests are...
Read more >
Configuring and managing high availability clusters Red Hat ...
If the majority of nodes go offline or become unavailable, the cluster no longer has quorum and Pacemaker stops clustered services. The quorum...
Read more >
Perspectives on retail and consumer goods - McKinsey
Charting a path forward. Redefining value and affordability in retail's next normal. The next normal: Retail M&A and partnerships after COVID-19.
Read more >
Does Chrome have a "Work Offline" option? - Stack Overflow
It looks like Chrome now has this feature via Chrome developer tools (Ctrl-Shift-I). Click on the "Device Mode" icon at the top-left.
Read more >
The ways of Workbox - Chrome Developers
Regardless of how you integrate with Workbox, the various tools offer a similar API. # generateSW vs injectManifest. You'll rely on one of...
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