You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[@vitejs/plugin-vue] When using the same Vue component in "popup" and "content UI", modifying the Vue component content will crash the popup after hot update. #270
@xbears Thanks for sharing! I could not reproduce the error with your ZIP on Mac, I'll give it a go on windows later today.
Videosmall.mp4
In the meantime, could you re-upload the reproduction with the lockfile? Including lockfiles is important so maintainers have the exact set of dependencies you had while creating the reproduction. It also tells us which package manager was being used, which is also important to reproducing some errors (here I guessed PNPM because of the .npmrc file).
If this isn't a Windows-only issue, my guess is it was an issue with Vite 5 that's been fixed. Although, I don't kno because I don't have your lockfile.
I was using vite@5.0.7 when attempting to reproduce.
Thanks for your reply, I tested it using a mac and it still reproduces, see the video below, I attached the zip with the lock, also the version of Vite it uses is 5.0.7 the latest version.
update:
I tested and found that only modifying <template> content to trigger a hot update triggers this issue. If <script> content is modified first, there is no problem after that.
I was able to reproduce, and this does only happen if re-using the component between entrypoints. Specifically, between a content script and HTML page. Doesn't happen between multiple UIs and doesn't happen between multiple content scripts.
Something weird must be going on between the HTML's HMR and the content script's bundling. Maybe they're getting combined somehow? They should be completely separate.
@DaPotatoMan thanks for sharing. I've seen that before, but if I inspect the plugins, there's only 1 vue plugin per vite build or vite dev. I think instead, the problem is the mixing of dev and build modes.
I think the solution might be to use the SSR tools vite provides to render the other files rather than using vite build, but I don't know if vite can SSR a JS file (like content scripts or the background), I think it's just for HTML. Need to look into it more.
changed the title [-]When using the same Vue component in "popup" and "content UI", modifying the Vue component content will crash the popup after hot update.[/-][+][@vitejs/plugin-vue] When using the same Vue component in "popup" and "content UI", modifying the Vue component content will crash the popup after hot update.[/+]on Jul 6, 2024
Activity
aklinker1 commentedon Dec 11, 2023
@xbears Thanks for sharing! I could not reproduce the error with your ZIP on Mac, I'll give it a go on windows later today.
Video
small.mp4
In the meantime, could you re-upload the reproduction with the lockfile? Including lockfiles is important so maintainers have the exact set of dependencies you had while creating the reproduction. It also tells us which package manager was being used, which is also important to reproducing some errors (here I guessed PNPM because of the
.npmrcfile).If this isn't a Windows-only issue, my guess is it was an issue with Vite 5 that's been fixed. Although, I don't kno because I don't have your lockfile.
I was using
vite@5.0.7when attempting to reproduce.xbears commentedon Dec 12, 2023
wxt-demo-with-lockfile.zip
Thanks for your reply, I tested it using a mac and it still reproduces, see the video below, I attached the zip with the lock, also the version of Vite it uses is
5.0.7the latest version.update:
I tested and found that only modifying
<template>content to trigger a hot update triggers this issue. If<script>content is modified first, there is no problem after that.Video
Screen.Recording.2023-12-12.mp4
aklinker1 commentedon Dec 14, 2023
I was able to reproduce, and this does only happen if re-using the component between entrypoints. Specifically, between a content script and HTML page. Doesn't happen between multiple UIs and doesn't happen between multiple content scripts.
Something weird must be going on between the HTML's HMR and the content script's bundling. Maybe they're getting combined somehow? They should be completely separate.
DaPotatoMan commentedon Mar 24, 2024
@aklinker1 I'm not sure if this helpful but it could be similar to this issue nuxt-modules/storybook#428 (comment)
aklinker1 commentedon Mar 24, 2024
@DaPotatoMan thanks for sharing. I've seen that before, but if I inspect the plugins, there's only 1 vue plugin per
vite buildorvite dev. I think instead, the problem is the mixing of dev and build modes.I think the solution might be to use the SSR tools vite provides to render the other files rather than using
vite build, but I don't know if vite can SSR a JS file (like content scripts or the background), I think it's just for HTML. Need to look into it more.[-]When using the same Vue component in "popup" and "content UI", modifying the Vue component content will crash the popup after hot update.[/-][+][@vitejs/plugin-vue] When using the same Vue component in "popup" and "content UI", modifying the Vue component content will crash the popup after hot update.[/+]