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

Plugin conflicts with vite-plugin-pwa #13

Open
TheDutchCoder opened this issue Jul 15, 2022 · 4 comments
Open

Plugin conflicts with vite-plugin-pwa #13

TheDutchCoder opened this issue Jul 15, 2022 · 4 comments

Comments

@TheDutchCoder
Copy link

I'm not sure what the cause is, but I have the feeling that the html file isn't fully written yet by the time the vite-plugin-pwa starts to work on it.

Does it maybe need to await certain processes to finish?

@lxs24sxl
Copy link
Owner

Can you provide a code snippet?

@lxs24sxl
Copy link
Owner

Is the cached resource still being accessed after the vite.config.js file is modified? On my side it is fine when I use vite-plugin-pwa.

@TheDutchCoder
Copy link
Author

I have stopped using the plugin, but I think the cause was that the plugin didn't actually pick up <%=VITE_VAR%> properly when it wasn't inside of an existing tag and therefore the PWA plugin would trip in invalid HTML.

Something like this:

<html>
  <head>
    <meta content="<%=VITE_THIS_WORKS" />
    <%=VITE_THIS_DOES_NOT%>
  </head>
  <body>
  </body>
</html>

@lxs24sxl
Copy link
Owner

Maybe you can use version 1.2.3, I debugged this version is no problem.

<html>
  <head>
    <meta content="<%= VITE_THIS_WORKS %>" />
  </head>
  <body>
  </body>
</html>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants