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

hmr is not working (cannot read properties of undefined) #10294

Closed
mdbetancourt opened this issue Sep 30, 2022 · 5 comments
Closed

hmr is not working (cannot read properties of undefined) #10294

mdbetancourt opened this issue Sep 30, 2022 · 5 comments
Labels
p3-significant High priority enhancement (priority)

Comments

@mdbetancourt
Copy link

mdbetancourt commented Sep 30, 2022

Describe the bug

components with script tag throw error (Uncaught TypeError: Cannot read properties of undefined (reading 'accept')) i notice this only happend with hmr enabled (works perfectly with hmr: false)
i figure out the error happen since 3.1.0 version of vite

Reproduction

reproduction

System Info

System:
    OS: Linux 5.19 Fedora Linux 36 (Workstation Edition)
    CPU: (16) x64 AMD Ryzen 7 3700X 8-Core Processor
    Memory: 22.37 GB / 31.25 GB
    Container: Yes
    Shell: 5.8 - ~/.local/bin/zsh
  Binaries:
    Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.16.0/bin/yarn
    npm: 8.11.0 - ~/.nvm/versions/node/v16.16.0/bin/npm
  Browsers:
    Chrome: 105.0.5195.52
    Firefox: 104.0
  npmPackages:
    @vitejs/plugin-vue: ^3.1.0 => 3.1.0 
    vite: ^3.1.4 => 3.1.4

Used Package Manager

pnpm

Logs

Click to expand! ```shell vite:config bundled config file loaded in 122.54ms +0ms vite:esbuild init tsconfck (root: /home/mdbetancourt/Documents/Projects/project/project-chat) +0ms vite:esbuild init tsconfck (root: /home/mdbetancourt/Documents/Projects/project/project-chat) +6ms vite:esbuild init tsconfck end +240ms vite:esbuild init tsconfck end +0ms vite:config using resolved config: { vite:config resolve: { alias: [ [Object], [Object], [Object] ] }, vite:config plugins: [ vite:config 'vite:pre-alias', vite:config 'alias', vite:config 'unocss:transformers:pre', vite:config 'unocss:global', vite:config 'vite:modulepreload-polyfill', vite:config 'vite:optimized-deps', vite:config 'vite:resolve', vite:config 'vite:html-inline-proxy', vite:config 'vite:css', vite:config 'vite:esbuild', vite:config 'vite:json', vite:config 'vite:wasm-helper', vite:config 'vite:worker', vite:config 'vite:asset', vite:config 'vite:vue', vite:config 'unocss:config', vite:config 'unocss:transformers:default', vite:config 'unocss:devtools', vite:config 'unocss:inspector', vite:config 'vite:wasm-fallback', vite:config 'vite:define', vite:config 'vite:css-post', vite:config 'vite:worker-import-meta-url', vite:config 'vite:dynamic-import-vars', vite:config 'vite:import-glob', vite:config 'unplugin-auto-import', vite:config 'unplugin-vue-components', vite:config 'unocss:transformers:post', vite:config 'unocss:global:post', vite:config 'vite:client-inject', vite:config 'vite:import-analysis' vite:config ], vite:config test: { environment: 'jsdom' }, vite:config optimizeDeps: { vite:config disabled: 'build', vite:config force: undefined, vite:config esbuildOptions: { preserveSymlinks: undefined } vite:config }, vite:config server: { vite:config preTransformRequests: true, vite:config port: 3333, vite:config middlewareMode: false, vite:config fs: { strict: true, allow: [Array], deny: [Array] } vite:config }, vite:config define: { __VUE_OPTIONS_API__: true, __VUE_PROD_DEVTOOLS__: false }, vite:config ssr: { vite:config format: 'esm', vite:config target: 'node', vite:config external: [], vite:config optimizeDeps: { disabled: true, esbuildOptions: [Object] } vite:config }, vite:config configFile: '/home/mdbetancourt/Documents/Projects/project/project-chat/vite.config.ts', vite:config configFileDependencies: [ vite:config '/home/mdbetancourt/Documents/Projects/project/project-chat/vite.config.ts' vite:config ], vite:config inlineConfig: { vite:config root: undefined, vite:config base: undefined, vite:config mode: undefined, vite:config configFile: undefined, vite:config logLevel: undefined, vite:config clearScreen: undefined, vite:config optimizeDeps: { force: undefined }, vite:config server: { port: 3333 } vite:config }, vite:config root: '/home/mdbetancourt/Documents/Projects/project/project-chat', vite:config base: '/', vite:config publicDir: '/home/mdbetancourt/Documents/Projects/project/project-chat/public', vite:config cacheDir: '/home/mdbetancourt/Documents/Projects/project/project-chat/node_modules/.vite', vite:config command: 'serve', vite:config mode: 'development', vite:config isWorker: false, vite:config mainConfig: null, vite:config isProduction: false, vite:config build: { vite:config target: [ 'es2020', 'edge88', 'firefox78', 'chrome87', 'safari13' ], vite:config polyfillModulePreload: true, vite:config outDir: 'dist', vite:config assetsDir: 'assets', vite:config assetsInlineLimit: 4096, vite:config cssCodeSplit: true, vite:config cssTarget: [ 'es2020', 'edge88', 'firefox78', 'chrome87', 'safari13' ], vite:config sourcemap: false, vite:config rollupOptions: {}, vite:config minify: 'esbuild', vite:config terserOptions: {}, vite:config write: true, vite:config emptyOutDir: null, vite:config manifest: false, vite:config lib: false, vite:config ssr: false, vite:config ssrManifest: false, vite:config reportCompressedSize: true, vite:config chunkSizeWarningLimit: 500, vite:config watch: null, vite:config commonjsOptions: { include: [Array], extensions: [Array] }, vite:config dynamicImportVarsOptions: { warnOnError: true, exclude: [Array] } vite:config }, vite:config preview: { vite:config port: undefined, vite:config strictPort: undefined, vite:config host: undefined, vite:config https: undefined, vite:config open: undefined, vite:config proxy: undefined, vite:config cors: undefined, vite:config headers: undefined vite:config }, vite:config env: { BASE_URL: '/', MODE: 'development', DEV: true, PROD: false }, vite:config assetsInclude: [Function: assetsInclude], vite:config logger: { vite:config hasWarned: false, vite:config info: [Function: info], vite:config warn: [Function: warn], vite:config warnOnce: [Function: warnOnce], vite:config error: [Function: error], vite:config clearScreen: [Function: clearScreen], vite:config hasErrorLogged: [Function: hasErrorLogged] vite:config }, vite:config packageCache: Map(0) {}, vite:config createResolver: [Function: createResolver], vite:config worker: { vite:config format: 'iife', vite:config plugins: [ vite:config 'vite:pre-alias', vite:config 'alias', vite:config 'vite:modulepreload-polyfill', vite:config 'vite:optimized-deps', vite:config 'vite:resolve', vite:config 'vite:html-inline-proxy', vite:config 'vite:css', vite:config 'vite:esbuild', vite:config 'vite:json', vite:config 'vite:wasm-helper', vite:config 'vite:worker', vite:config 'vite:asset', vite:config 'vite:wasm-fallback', vite:config 'vite:define', vite:config 'vite:css-post', vite:config 'vite:worker-import-meta-url', vite:config 'vite:dynamic-import-vars', vite:config 'vite:import-glob', vite:config 'vite:client-inject', vite:config 'vite:import-analysis' vite:config ], vite:config rollupOptions: {}, vite:config getSortedPlugins: [Function: getSortedPlugins], vite:config getSortedPluginHooks: [Function: getSortedPluginHooks] vite:config }, vite:config appType: 'spa', vite:config experimental: { importGlobRestoreExtension: false, hmrPartialAccept: false }, vite:config getSortedPlugins: [Function: getSortedPlugins], vite:config getSortedPluginHooks: [Function: getSortedPluginHooks] vite:config } +249ms vite:deps Hash is consistent. Skipping. Use --force to override. +0ms

VITE v3.1.4 ready in 539 ms

➜ Local: http://127.0.0.1:3333/
➜ Network: use --host to expose
vite:spa-fallback Rewriting GET / to /index.html +0ms
vite:spa-fallback Rewriting GET / to /index.html +5ms
vite:time 34.42ms /index.html +0ms
vite:time 27.67ms /index.html +1ms
vite:spa-fallback Rewriting GET / to /index.html +30ms
vite:time 3.26ms /index.html +5ms
vite:spa-fallback Rewriting GET / to /index.html +6ms
vite:time 3.97ms /index.html +6ms
vite:spa-fallback Rewriting GET / to /index.html +4ms
vite:time 6.55ms /index.html +8ms
vite:spa-fallback Rewriting GET / to /index.html +9ms
vite:time 3.62ms /index.html +5ms
vite:resolve 1.77ms /@vite/client -> /home/mdbetancourt/Documents/Projects/project/project-chat/node_modules/.pnpm/vite@3.1.4/node_modules/vite/dist/client/client.mjs +0ms
vite:resolve 0.36ms /src/main.ts -> /home/mdbetancourt/Documents/Projects/project/project-chat/src/main.ts +4ms
vite:load 0.89ms [fs] /src/main.ts +0ms
vite:load 5.71ms [fs] /@vite/client +2ms
vite:resolve 0.41ms @vite/env -> /home/mdbetancourt/Documents/Projects/project/project-chat/node_modules/.pnpm/vite@3.1.4/node_modules/vite/dist/client/env.mjs +10ms
vite:resolve 0.16ms /node_modules/.pnpm/vite@3.1.4/node_modules/vite/dist/client/env.mjs -> /home/mdbetancourt/Documents/Projects/project/project-chat/node_modules/.pnpm/vite@3.1.4/node_modules/vite/dist/client/env.mjs +0ms
vite:import-analysis 3.96ms [1 imports rewritten] node_modules/.pnpm/vite@3.1.4/node_modules/vite/dist/client/client.mjs +0ms
vite:transform 7.34ms /@vite/client +0ms
vite:time 18.11ms /@vite/client +24ms
vite:resolve 0.17ms vue -> /home/mdbetancourt/Documents/Projects/project/project-chat/node_modules/.vite/deps/vue.js?v=499b51c6 +5ms
vite:resolve 0.04ms /node_modules/.vite/deps/vue.js?v=499b51c6 -> /home/mdbetancourt/Documents/Projects/project/project-chat/node_modules/.vite/deps/vue.js?v=499b51c6 +0ms
vite:resolve 0.04ms pinia -> /home/mdbetancourt/Documents/Projects/project/project-chat/node_modules/.vite/deps/pinia.js?v=499b51c6 +1ms
vite:resolve 0.03ms /node_modules/.vite/deps/pinia.js?v=499b51c6 -> /home/mdbetancourt/Documents/Projects/project/project-chat/node_modules/.vite/deps/pinia.js?v=499b51c6 +0ms
vite:resolve 0.17ms ./apps/AdminChat.vue -> /home/mdbetancourt/Documents/Projects/project/project-chat/src/apps/AdminChat.vue +0ms
vite:resolve 0.08ms /src/apps/AdminChat.vue -> /home/mdbetancourt/Documents/Projects/project/project-chat/src/apps/AdminChat.vue +0ms
vite:resolve 1.85ms @unocss/reset/tailwind.css -> /home/mdbetancourt/Documents/Projects/project/project-chat/node_modules/.pnpm/@unocss+reset@0.45.26/node_modules/@unocss/reset/tailwind.css +2ms
vite:resolve 0.12ms /node_modules/.pnpm/@unocss+reset@0.45.26/node_modules/@unocss/reset/tailwind.css -> /home/mdbetancourt/Documents/Projects/project/project-chat/node_modules/.pnpm/@unocss+reset@0.45.26/node_modules/@unocss/reset/tailwind.css +0ms
vite:resolve 0.10ms ./styles/main.css -> /home/mdbetancourt/Documents/Projects/project/project-chat/src/styles/main.css +1ms
vite:resolve 0.11ms /src/styles/main.css -> /home/mdbetancourt/Documents/Projects/project/project-chat/src/styles/main.css +0ms
vite:resolve 0.11ms uno.css -> /__uno.css +0ms
vite:import-analysis 4.68ms [6 imports rewritten] src/main.ts +9ms
vite:transform 18.13ms /src/main.ts +9ms
vite:time 20.86ms /src/main.ts +9ms
vite:optimize-deps load /home/mdbetancourt/Documents/Projects/project/project-chat/node_modules/.vite/deps/vue.js +0ms
vite:optimize-deps load /home/mdbetancourt/Documents/Projects/project/project-chat/node_modules/.vite/deps/pinia.js +0ms
vite:load 34.04ms [plugin] /__uno.css +52ms
vite:cache [304] /@vite/client +0ms
vite:time 0.58ms /@vite/client +37ms
vite:cache [304] /src/main.ts +1ms
vite:time 0.28ms /src/main.ts +1ms
vite:load 46.89ms [fs] /node_modules/.pnpm/vite@3.1.4/node_modules/vite/dist/client/env.mjs +4ms
vite:load 5.50ms [plugin] /node_modules/.vite/deps/vue.js?v=499b51c6 +0ms
vite:resolve 0.32ms ./chunk-GLITNA64.js -> /home/mdbetancourt/Documents/Projects/project/project-chat/node_modules/.vite/deps/chunk-GLITNA64.js?v=499b51c6 +42ms
vite:resolve 0.04ms /node_modules/.vite/deps/chunk-GLITNA64.js?v=499b51c6 -> /home/mdbetancourt/Documents/Projects/project/project-chat/node_modules/.vite/deps/chunk-GLITNA64.js?v=499b51c6 +0ms
vite:import-analysis 1.30ms [1 imports rewritten] node_modules/.vite/deps/vue.js?v=499b51c6 +41ms
vite:transform 1.56ms /node_modules/.vite/deps/vue.js?v=499b51c6 +41ms
vite:optimize-deps load /home/mdbetancourt/Documents/Projects/project/project-chat/node_modules/.vite/deps/chunk-GLITNA64.js +7ms
vite:load 7.51ms [fs] /src/apps/AdminChat.vue +2ms
vite:resolve 0.07ms /src/components/ChatConversation.vue -> /home/mdbetancourt/Documents/Projects/project/project-chat/src/components/ChatConversation.vue +17ms
vite:hmr [self-accepts] src/apps/AdminChat.vue +0ms
vite:import-analysis 1.74ms [3 imports rewritten] src/apps/AdminChat.vue +18ms
vite:transform 19.85ms /src/apps/AdminChat.vue +20ms
vite:cache [memory] /node_modules/.vite/deps/vue.js?v=499b51c6 +0ms
vite:load 0.53ms [plugin] plugin-vue:export-helper +22ms
vite:import-analysis 0.03ms [no imports] plugin-vue:export-helper +4ms
vite:transform 0.15ms plugin-vue:export-helper +2ms
vite:load 28.90ms [plugin] /node_modules/.vite/deps/pinia.js?v=499b51c6 +0ms
vite:resolve 0.09ms ./chunk-XCZD5OPM.js -> /home/mdbetancourt/Documents/Projects/project/project-chat/node_modules/.vite/deps/chunk-XCZD5OPM.js?v=499b51c6 +6ms
vite:resolve 0.04ms /node_modules/.vite/deps/chunk-XCZD5OPM.js?v=499b51c6 -> /home/mdbetancourt/Documents/Projects/project/project-chat/node_modules/.vite/deps/chunk-XCZD5OPM.js?v=499b51c6 +0ms
vite:import-analysis 1.68ms [2 imports rewritten] node_modules/.vite/deps/pinia.js?v=499b51c6 +2ms
vite:transform 2.01ms /node_modules/.vite/deps/pinia.js?v=499b51c6 +2ms
vite:optimize-deps load /home/mdbetancourt/Documents/Projects/project/project-chat/node_modules/.vite/deps/chunk-XCZD5OPM.js +24ms
vite:load 31.45ms [fs] /node_modules/.pnpm/@unocss+reset@0.45.26/node_modules/@unocss/reset/tailwind.css +2ms
vite:load 32.25ms [fs] /src/styles/main.css +1ms
vite:import-analysis 1.12ms [no imports] node_modules/.pnpm/vite@3.1.4/node_modules/vite/dist/client/env.mjs +3ms
vite:transform 29.22ms /node_modules/.pnpm/vite@3.1.4/node_modules/vite/dist/client/env.mjs +3ms
vite:cache [304] /@vite/client +31ms
vite:time 0.43ms /@vite/client +31ms
vite:cache [304] /src/main.ts +1ms
vite:time 0.40ms /src/main.ts +1ms
vite:load 18.72ms [fs] /src/components/ChatConversation.vue +15ms
vite:load 55.33ms [plugin] /node_modules/.vite/deps/chunk-XCZD5OPM.js?v=499b51c6 +40ms
vite:import-analysis 0.03ms [no imports] node_modules/.vite/deps/chunk-XCZD5OPM.js?v=499b51c6 +53ms
vite:transform 0.23ms /node_modules/.vite/deps/chunk-XCZD5OPM.js?v=499b51c6 +53ms
vite:load 79.78ms [plugin] /node_modules/.vite/deps/chunk-GLITNA64.js?v=499b51c6 +0ms
vite:import-analysis 2.75ms [no imports] node_modules/.vite/deps/chunk-GLITNA64.js?v=499b51c6 +4ms
vite:transform 3.86ms /node_modules/.vite/deps/chunk-GLITNA64.js?v=499b51c6 +4ms
vite:cache [304] /node_modules/.pnpm/vite@3.1.4/node_modules/vite/dist/client/env.mjs +56ms
vite:time 0.36ms /node_modules/.pnpm/vite@3.1.4/node_modules/vite/dist/client/env.mjs +56ms
vite:cache [304] /node_modules/.pnpm/vite@3.1.4/node_modules/vite/dist/client/env.mjs +5ms
vite:time 0.32ms /node_modules/.pnpm/vite@3.1.4/node_modules/vite/dist/client/env.mjs +5ms
vite:cache [304] /node_modules/.pnpm/vite@3.1.4/node_modules/vite/dist/client/env.mjs +1ms
vite:time 0.22ms /node_modules/.pnpm/vite@3.1.4/node_modules/vite/dist/client/env.mjs +1ms
vite:resolve 0.07ms /src/store/user.store.ts -> /home/mdbetancourt/Documents/Projects/project/project-chat/src/store/user.store.ts +95ms
vite:resolve 0.04ms @vueuse/core -> /home/mdbetancourt/Documents/Projects/project/project-chat/node_modules/.vite/deps/@vueuse_core.js?v=499b51c6 +0ms
vite:resolve 0.02ms /node_modules/.vite/deps/@vueuse_core.js?v=499b51c6 -> /home/mdbetancourt/Documents/Projects/project/project-chat/node_modules/.vite/deps/@vueuse_core.js?v=499b51c6 +1ms
vite:resolve 0.07ms /src/components/ChatConversation.vue?vue&type=style&index=0&lang.css -> /home/mdbetancourt/Documents/Projects/project/project-chat/src/components/ChatConversation.vue?vue&type=style&index=0&lang.css +0ms
vite:import-analysis 2.42ms [6 imports rewritten] src/components/ChatConversation.vue +36ms
vite:transform 81.23ms /src/components/ChatConversation.vue +37ms
vite:cache [memory] /node_modules/.vite/deps/pinia.js?v=499b51c6 +101ms
vite:cache [memory] /node_modules/.vite/deps/vue.js?v=499b51c6 +0ms
vite:cache [memory] plugin-vue:export-helper +0ms
vite:optimize-deps load /home/mdbetancourt/Documents/Projects/project/project-chat/node_modules/.vite/deps/@vueuse_core.js +98ms
vite:load 0.16ms [plugin] /src/components/ChatConversation.vue?vue&type=style&index=0&lang.css +42ms
vite:hmr [self-accepts] src/components/ChatConversation.vue?vue&type=style&index=0&lang.css +119ms
vite:import-analysis 0.18ms [0 imports rewritten] src/components/ChatConversation.vue?vue&type=style&index=0&lang.css +17ms
vite:transform 14.90ms /src/components/ChatConversation.vue?vue&type=style&index=0&lang.css +16ms
vite:hmr [self-accepts] /__uno.css +7ms
vite:import-analysis 0.15ms [0 imports rewritten] /__uno.css +7ms
vite:transform 149.66ms /__uno.css +7ms
vite:hmr [self-accepts] node_modules/.pnpm/@unocss+reset@0.45.26/node_modules/@unocss/reset/tailwind.css +0ms
vite:import-analysis 0.18ms [0 imports rewritten] node_modules/.pnpm/@unocss+reset@0.45.26/node_modules/@unocss/reset/tailwind.css +0ms
vite:transform 119.73ms /node_modules/.pnpm/@unocss+reset@0.45.26/node_modules/@unocss/reset/tailwind.css +0ms
vite:load 22.71ms [fs] /src/store/user.store.ts +23ms
vite:hmr [self-accepts] src/styles/main.css +1ms
vite:import-analysis 0.09ms [0 imports rewritten] src/styles/main.css +1ms
vite:transform 120.07ms /src/styles/main.css +1ms
vite:load 23.55ms [plugin] /node_modules/.vite/deps/@vueuse_core.js?v=499b51c6 +0ms
vite:import-analysis 3.27ms [2 imports rewritten] node_modules/.vite/deps/@vueuse_core.js?v=499b51c6 +4ms
vite:transform 4.00ms /node_modules/.vite/deps/@vueuse_core.js?v=499b51c6 +5ms
vite:cache [memory] /node_modules/.vite/deps/chunk-XCZD5OPM.js?v=499b51c6 +28ms
vite:cache [memory] /node_modules/.vite/deps/chunk-GLITNA64.js?v=499b51c6 +0ms
vite:cache [304] /src/apps/AdminChat.vue +60ms
vite:time 0.33ms /src/apps/AdminChat.vue +60ms
vite:import-analysis 0.60ms [2 imports rewritten] src/store/user.store.ts +3ms
vite:transform 7.81ms /src/store/user.store.ts +3ms
vite:cache [memory] /node_modules/.vite/deps/vue.js?v=499b51c6 +3ms
vite:cache [memory] /node_modules/.vite/deps/pinia.js?v=499b51c6 +0ms
vite:cache [304] /node_modules/.pnpm/@unocss+reset@0.45.26/node_modules/@unocss/reset/tailwind.css +3ms
vite:time 0.40ms /node_modules/.pnpm/@unocss+reset@0.45.26/node_modules/@unocss/reset/tailwind.css +3ms
vite:cache [304] /src/apps/AdminChat.vue +0ms
vite:time 0.34ms /src/apps/AdminChat.vue +0ms
vite:cache [304] /src/styles/main.css +3ms
vite:time 0.38ms /src/styles/main.css +3ms
vite:cache [304] /node_modules/.pnpm/@unocss+reset@0.45.26/node_modules/@unocss/reset/tailwind.css +1ms
vite:time 0.35ms /node_modules/.pnpm/@unocss+reset@0.45.26/node_modules/@unocss/reset/tailwind.css +1ms
vite:cache [304] /src/styles/main.css +34ms
vite:time 0.31ms /src/styles/main.css +34ms
vite:cache [304] /src/apps/AdminChat.vue +1ms
vite:time 0.20ms /src/apps/AdminChat.vue +1ms
vite:cache [304] /src/components/ChatConversation.vue +0ms
vite:time 0.19ms /src/components/ChatConversation.vue +0ms
vite:cache [304] /node_modules/.pnpm/@unocss+reset@0.45.26/node_modules/@unocss/reset/tailwind.css +0ms
vite:time 0.22ms /node_modules/.pnpm/@unocss+reset@0.45.26/node_modules/@unocss/reset/tailwind.css +0ms
vite:cache [304] plugin-vue:export-helper +1ms
vite:time 0.17ms /@id/__x00__plugin-vue:export-helper +1ms
vite:cache [304] /src/styles/main.css +0ms
vite:time 0.20ms /src/styles/main.css +0ms
vite:cache [304] /src/components/ChatConversation.vue +8ms
vite:time 0.33ms /src/components/ChatConversation.vue +8ms
vite:cache [304] plugin-vue:export-helper +0ms
vite:time 0.12ms /@id/__x00__plugin-vue:export-helper +0ms
vite:cache [304] /src/store/user.store.ts +1ms
vite:time 0.18ms /src/store/user.store.ts +1ms
vite:cache [304] /src/components/ChatConversation.vue?vue&type=style&index=0&lang.css +0ms
vite:time 0.46ms /src/components/ChatConversation.vue?vue&type=style&index=0&lang.css +0ms
vite:cache [304] /src/components/ChatConversation.vue +1ms
vite:time 0.24ms /src/components/ChatConversation.vue +1ms
vite:cache [304] plugin-vue:export-helper +13ms
vite:time 0.18ms /@id/__x00__plugin-vue:export-helper +13ms
vite:cache [304] /src/store/user.store.ts +1ms
vite:time 0.21ms /src/store/user.store.ts +1ms
vite:cache [304] /src/store/user.store.ts +0ms
vite:time 0.18ms /src/store/user.store.ts +0ms
vite:cache [304] /src/components/ChatConversation.vue?vue&type=style&index=0&lang.css +1ms
vite:time 0.32ms /src/components/ChatConversation.vue?vue&type=style&index=0&lang.css +1ms
vite:cache [304] /src/components/ChatConversation.vue?vue&type=style&index=0&lang.css +13ms
vite:time 0.29ms /src/components/ChatConversation.vue?vue&type=style&index=0&lang.css +13ms
vite:load 75.55ms [plugin] /__uno.css +91ms
vite:hmr [self-accepts] /__uno.css +94ms
vite:import-analysis 0.10ms [0 imports rewritten] /__uno.css +87ms
vite:transform 2.86ms /__uno.css +86ms
vite:time 80.38ms /__uno.css +7ms
vite:time 36.47ms /__uno.css +0ms
vite:cache [304] /__uno.css +9ms
vite:time 0.13ms /__uno.css +2ms
vite:spa-fallback Not rewriting GET /favicon.svg because the path includes a dot (.) character. +324ms
vite:time 0.67ms /favicon.svg +6ms
vite:spa-fallback Not rewriting GET /favicon.svg because the path includes a dot (.) character. +1ms
vite:time 0.35ms /favicon.svg +1ms
vite:spa-fallback Not rewriting GET /favicon.svg because the path includes a dot (.) character. +2ms
vite:time 0.49ms /favicon.svg +2ms
vite:deps ✨ static imports crawl ended +2s
vite:spa-fallback Rewriting GET / to /index.html +20s
vite:time 4.19ms /index.html +20s
vite:cache [304] /@vite/client +20s
vite:time 0.76ms /@vite/client +23ms
vite:cache [304] /src/main.ts +1ms
vite:time 0.37ms /src/main.ts +1ms
vite:cache [304] /node_modules/.pnpm/vite@3.1.4/node_modules/vite/dist/client/env.mjs +111ms
vite:time 0.63ms /node_modules/.pnpm/vite@3.1.4/node_modules/vite/dist/client/env.mjs +111ms
vite:cache [304] /src/apps/AdminChat.vue +46ms
vite:time 0.65ms /src/apps/AdminChat.vue +46ms
vite:cache [304] /node_modules/.pnpm/@unocss+reset@0.45.26/node_modules/@unocss/reset/tailwind.css +1ms
vite:time 0.56ms /node_modules/.pnpm/@unocss+reset@0.45.26/node_modules/@unocss/reset/tailwind.css +1ms
vite:cache [304] /src/styles/main.css +1ms
vite:time 0.45ms /src/styles/main.css +1ms
vite:cache [304] /__uno.css +1ms
vite:time 0.25ms /__uno.css +1ms
vite:cache [304] /src/components/ChatConversation.vue +6ms
vite:time 0.77ms /src/components/ChatConversation.vue +6ms
vite:cache [304] plugin-vue:export-helper +1ms
vite:time 0.25ms /@id/__x00__plugin-vue:export-helper +1ms
vite:cache [304] /src/store/user.store.ts +6ms
vite:time 0.54ms /src/store/user.store.ts +6ms
vite:cache [304] /src/components/ChatConversation.vue?vue&type=style&index=0&lang.css +0ms
vite:time 0.46ms /src/components/ChatConversation.vue?vue&type=style&index=0&lang.css +0ms
vite:spa-fallback Not rewriting GET /favicon.svg because the path includes a dot (.) character. +227ms
vite:time 0.71ms /favicon.svg +27ms

</details>

### Validations

- [X] Follow our [Code of Conduct](https://github.com/vitejs/vite/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guidelines](https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://vitejs.dev/guide).
- [X] Check that there isn't [already an issue](https://github.com/vitejs/vite/issues) that reports the same bug to avoid creating a duplicate.
- [X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to [vuejs/core](https://github.com/vuejs/core) instead.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/vitejs/vite/discussions) or join our [Discord Chat Server](https://chat.vitejs.dev/).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
@github-actions
Copy link

Hello @mdbetancourt. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.

@realityfilter
Copy link

The same here. Reverting vite to 3.0.9 is working again.

@realityfilter
Copy link

Here is the problematic line of a vue component.
import_meta.hot is undefined.

typeof __VUE_HMR_RUNTIME__ !== "undefined" && __VUE_HMR_RUNTIME__.createRecord(_sfc_main.__hmrId, _sfc_main);
import_meta.hot.accept((mod) => {
  if (!mod)
    return;
  const { default: updated, _rerender_only } = mod;
  if (_rerender_only) {
    __VUE_HMR_RUNTIME__.rerender(updated.__hmrId, updated.render);
  } else {
    __VUE_HMR_RUNTIME__.reload(updated.__hmrId, updated);
  }
});

@antfu
Copy link
Member

antfu commented Oct 1, 2022

I can confirm this is introduced in

const { code, map } = await transformWithEsbuild(
resolvedCode,
filename,
{
loader: 'ts',
target: 'esnext',
sourcemap: options.sourceMap
},
resolvedMap
)
where esbuild transpiled import.meta into import_meta before Vite has a chance to process it.

A temporary workaround is to change the target in your tsconfig with es2020 or above.

@antfu antfu added bug p3-significant High priority enhancement (priority) and removed needs reproduction labels Oct 1, 2022
@brc-dd
Copy link
Contributor

brc-dd commented Oct 2, 2022

Should be fixed now. Update plugin-vue to 3.1.2. Also, in your provided reproduction, you need to change script in index.html to /src/main.ts.

@antfu antfu closed this as completed Oct 2, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-significant High priority enhancement (priority)
Projects
None yet
Development

No branches or pull requests

5 participants