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.

Conflicts with `vite-plugin-pwa`

See original GitHub issue

Description

Here is what fakeHtml looks like when using vite-plugin-pwa.

<html> <head>
   <script type="module" src="/@vite/client"></script>
<link rel="manifest" href="/manifest.webmanifest"></head><body><script type="module" src="/@vite-plugin-pwa/pwa-entry-point-loaded"></script></body></html>

It is worth noting that I’m using solid with streams. Removing vite-plugin-pwa bypasses the issue.

Error Stack

Error: [vite-plugin-ssr@0.4.13][Wrong Usage] You are using a Vite Plugin that transforms the HTML in a way that conflicts with vite-plugin-ssr. Create a new GitHub ticket to discuss a solution.
    at null.getViteDevScripts (/home/magne/workspace/website-patch-notes/node_modules/.pnpm/vite-plugin-ssr@0.4.13_vite@3.0.3/node_modules/vite-plugin-ssr/dist/cjs/node/html/injectAssets/getViteDevScripts.js:16:17)
    at runMicrotasks (<anonymous>)
    at null.getMergedScriptTag (/home/magne/workspace/website-patch-notes/node_modules/.pnpm/vite-plugin-ssr@0.4.13_vite@3.0.3/node_modules/vite-plugin-ssr/dist/cjs/node/html/injectAssets.js:126:25)
    at null.getHtmlSnippets (/home/magne/workspace/website-patch-notes/node_modules/.pnpm/vite-plugin-ssr@0.4.13_vite@3.0.3/node_modules/vite-plugin-ssr/dist/cjs/node/html/injectAssets.js:81:22)
    at null.injectAtStreamBegin (/home/magne/workspace/website-patch-notes/node_modules/.pnpm/vite-plugin-ssr@0.4.13_vite@3.0.3/node_modules/vite-plugin-ssr/dist/cjs/node/html/injectAssets.js:46:24)
    at null.injectStringAtBegin (/home/magne/workspace/website-patch-notes/node_modules/.pnpm/vite-plugin-ssr@0.4.13_vite@3.0.3/node_modules/vite-plugin-ssr/dist/cjs/node/html/renderHtml.js:79:24)
    at null.<anonymous> (/home/magne/workspace/website-patch-notes/node_modules/.pnpm/vite-plugin-ssr@0.4.13_vite@3.0.3/node_modules/vite-plugin-ssr/dist/cjs/node/html/stream.js:213:49)

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
brilloutcommented, Jul 29, 2022

That’s a good point, yes we could whitelist vite-plugin-pwa for dev. For other HTML transformers we can show a warning instead of throwing an error.

It’s not a trivial change, so I’ll implement this later. If someone wants that change, feel free to push by adding a comment here.

1reaction
brilloutcommented, Jul 28, 2022

Yep that was actually the plan 😃.

I’ll see if I can manually do that.

Keep me updated and I’ll then improve the error message to link to this discussion.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problems encountered in using vite plugin PWA in vue3 #349
Use vite plugin PWA in vue3. Every time you update the business code, vite will hot update and refresh the browser.
Read more >
How to configure worker plugins in Vite 2.8 - LogRocket Blog
In this article, we'll explore how to properly configure worker plugins with Vite for a functional progressive web application (PWA).
Read more >
Development | Guide - Vite PWA - Netlify
When using this strategy, the vite-plugin-pwa plugin will delegate the service worker compilation to Vite , so if you're using import statements ...
Read more >
VitePWA plugin not updating generated icons in manifest
I am trying to build the site with vite and vite-plugin-pwa to use it as a pwa. The vite.config.js and the index.html are...
Read more >
PWA in VUE VITE - DEV Community ‍ ‍
InjectRegister Plugin Option: This configuration helps to control how to register the service worker in my application, although the ...
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