vitejs / vite

Next generation frontend tooling. It's fast!
http://vite.dev
MIT License
68.5k stars 6.18k forks source link

vite is (accidentally) very slow when first starting or switching routes #11383

Closed laterdays closed 1 year ago

laterdays commented 1 year ago

Describe the bug

vite is (accidentally) very slow when first starting or switching routes

Reproduction

*

Steps to reproduce

first starting or switching routes

System Info

windows

Used Package Manager

yarn

Logs

vite:resolve 144.23ms @unocss/preset-wind -> E:/projects/E-fab/node_modules/@unocss/preset-wind/dist/index.mjs +162ms
  vite:resolve 144.53ms @unocss/core -> E:/projects/E-fab/node_modules/@unocss/core/dist/index.mjs +0ms
  vite:resolve 144.64ms vue-demi -> E:/projects/E-fab/node_modules/vue-demi/lib/index.mjs +1ms
  vite:resolve 144.67ms vooks -> E:/projects/E-fab/node_modules/vooks/es/index.js +0ms
  vite:resolve 144.70ms @intlify/shared -> E:/projects/E-fab/node_modules/@intlify/shared/dist/shared.mjs +0ms      
  vite:resolve 144.77ms ohmyfetch -> E:/projects/E-fab/node_modules/ohmyfetch/dist/index.mjs +0ms
  vite:resolve 144.85ms vue -> E:/projects/E-fab/node_modules/vue/dist/vue.runtime.esm-bundler.js +0ms
  vite:resolve 144.92ms zrender/lib/canvas/Painter.js -> E:/projects/E-fab/node_modules/zrender/lib/canvas/Painter.js +1ms
  vite:resolve 145.05ms zrender/lib/svg/Painter.js -> E:/projects/E-fab/node_modules/zrender/lib/svg/Painter.js +0ms  vite:resolve 145.13ms zrender/lib/core/util.js -> E:/projects/E-fab/node_modules/zrender/lib/core/util.js +0ms    
  vite:resolve 144.73ms @vue/runtime-core -> E:/projects/E-fab/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +0ms
  vite:resolve 144.89ms zrender/lib/core/Transformable.js -> E:/projects/E-fab/node_modules/zrender/lib/core/Transformable.js +0ms
  vite:resolve 145.05ms zrender/lib/zrender.js -> E:/projects/E-fab/node_modules/zrender/lib/zrender.js +1ms        
  vite:resolve 145.02ms tslib -> E:/projects/E-fab/node_modules/tslib/tslib.es6.js +0ms
  vite:resolve 4.70ms side-channel -> E:/projects/E-fab/node_modules/side-channel/index.js +0ms
  vite:load 2.89ms [plugin] /__uno.css +196ms
  vite:hmr [self-accepts] /__uno.css +163ms
  vite:import-analysis 0.35ms [0 imports rewritten] /__uno.css +163ms
  vite:transform 1.01ms /__uno.css +162ms
  vite:time 5.22ms /__uno.css +192ms
  vite:resolve 759.20ms dijkstrajs -> E:/projects/E-fab/node_modules/dijkstrajs/dijkstra.js +770ms
  vite:resolve 752.75ms form-data -> E:/projects/E-fab/node_modules/form-data/lib/browser.js +775ms
  vite:resolve 751.90ms @vue/devtools-api -> E:/projects/E-fab/node_modules/@vue/devtools-api/lib/esm/index.js +0ms 
  vite:resolve 752.13ms zrender/lib/core/env.js -> E:/projects/E-fab/node_modules/zrender/lib/core/env.js +0ms      
  vite:resolve 752.40ms @intlify/core-base -> E:/projects/E-fab/node_modules/@intlify/core-base/dist/core-base.mjs +1ms
  vite:resolve 752.63ms @vue/shared -> E:/projects/E-fab/node_modules/@vue/shared/dist/shared.esm-bundler.js +0ms   
  vite:resolve 752.74ms zrender/lib/core/matrix.js -> E:/projects/E-fab/node_modules/zrender/lib/core/matrix.js +0ms  vite:resolve 752.91ms @unocss/preset-mini -> E:/projects/E-fab/node_modules/@unocss/preset-mini/dist/index.mjs +0ms
  vite:resolve 753.17ms zrender/lib/graphic/Path.js -> E:/projects/E-fab/node_modules/zrender/lib/graphic/Path.js +1ms
  vite:resolve 753.24ms get-intrinsic -> E:/projects/E-fab/node_modules/get-intrinsic/index.js +3ms
  vite:resolve 753.02ms css-render -> E:/projects/E-fab/node_modules/css-render/esm/index.js +0ms
  vite:resolve 753.12ms zrender/lib/graphic/Text.js -> E:/projects/E-fab/node_modules/zrender/lib/graphic/Text.js +1ms
  vite:resolve 753.36ms zrender/lib/tool/path.js -> E:/projects/E-fab/node_modules/zrender/lib/tool/path.js +0ms    
  vite:resolve 348.99ms date-fns/esm/locale/ja -> E:/projects/E-fab/node_modules/date-fns/esm/locale/ja/index.js +360ms
  vite:resolve 349.31ms date-fns/esm/locale/sk -> E:/projects/E-fab/node_modules/date-fns/esm/locale/sk/index.js +0ms
  vite:resolve 349.52ms date-fns/esm/locale/ko -> E:/projects/E-fab/node_modules/date-fns/esm/locale/ko/index.js +0ms
  vite:resolve 349.67ms date-fns/esm/locale/de -> E:/projects/E-fab/node_modules/date-fns/esm/locale/de/index.js +0ms
  vite:resolve 349.85ms date-fns/esm/locale/id -> E:/projects/E-fab/node_modules/date-fns/esm/locale/id/index.js +1ms
  vite:resolve 350.01ms date-fns/esm/locale/en-GB -> E:/projects/E-fab/node_modules/date-fns/esm/locale/en-GB/index.js +0ms
  vite:resolve 350.16ms date-fns/esm/locale/nb -> E:/projects/E-fab/node_modules/date-fns/esm/locale/nb/index.js +0ms
  vite:resolve 350.34ms date-fns/esm/locale/pl -> E:/projects/E-fab/node_modules/date-fns/esm/locale/pl/index.js +0ms
  vite:resolve 350.49ms date-fns/esm/locale/nl -> E:/projects/E-fab/node_modules/date-fns/esm/locale/nl/index.js +1ms
  vite:resolve 350.66ms date-fns/esm/locale/ar -> E:/projects/E-fab/node_modules/date-fns/esm/locale/ar/index.js +0ms
  vite:resolve 350.86ms date-fns/esm/locale/pt-BR -> E:/projects/E-fab/node_modules/date-fns/esm/locale/pt-BR/index.js +0ms
  vite:resolve 351.17ms date-fns/esm/locale/th -> E:/projects/E-fab/node_modules/date-fns/esm/locale/th/index.js +0ms
  vite:resolve 351.51ms date-fns/esm/locale/fr -> E:/projects/E-fab/node_modules/date-fns/esm/locale/fr/index.js +1ms
  vite:resolve 351.81ms date-fns/esm/locale/es -> E:/projects/E-fab/node_modules/date-fns/esm/locale/es/index.js +0ms
  vite:resolve 352.10ms date-fns/esm/locale/it -> E:/projects/E-fab/node_modules/date-fns/esm/locale/it/index.js +1ms
  vite:resolve 352.36ms date-fns/esm/locale/ru -> E:/projects/E-fab/node_modules/date-fns/esm/locale/ru/index.js +0ms
  vite:resolve 352.69ms date-fns/esm/locale/en-US -> E:/projects/E-fab/node_modules/date-fns/esm/locale/en-US/index.js +0ms
  vite:resolve 353.02ms date-fns/esm/locale/zh-TW -> E:/projects/E-fab/node_modules/date-fns/esm/locale/zh-TW/index.js +1ms
  vite:resolve 353.30ms date-fns/esm/locale/uk -> E:/projects/E-fab/node_modules/date-fns/esm/locale/uk/index.js +0ms
  vite:resolve 353.54ms date-fns/esm/locale/zh-CN -> E:/projects/E-fab/node_modules/date-fns/esm/locale/zh-CN/index.js +0ms
  vite:resolve 353.80ms date-fns/esm/locale/tr -> E:/projects/E-fab/node_modules/date-fns/esm/locale/tr/index.js +1ms
  vite:resolve 354.04ms date-fns/esm/locale/vi -> E:/projects/E-fab/node_modules/date-fns/esm/locale/vi/index.js +0ms
  vite:resolve 354.31ms date-fns/esm/locale/eo -> E:/projects/E-fab/node_modules/date-fns/esm/locale/eo/index.js +0ms
  vite:resolve 354.55ms lodash-es -> E:/projects/E-fab/node_modules/lodash-es/lodash.js +1ms
  vite:resolve 354.32ms seemly -> E:/projects/E-fab/node_modules/seemly/es/index.js +0ms
  vite:resolve 967.26ms qrcode -> E:/projects/E-fab/node_modules/qrcode/lib/browser.js +977ms
  vite:resolve 967.38ms zrender/lib/core/BoundingRect.js -> E:/projects/E-fab/node_modules/zrender/lib/core/BoundingRect.js +0ms
  vite:resolve 967.61ms zrender/lib/tool/color.js -> E:/projects/E-fab/node_modules/zrender/lib/tool/color.js +0ms  
  vite:resolve 967.29ms zrender/lib/core/bbox.js -> E:/projects/E-fab/node_modules/zrender/lib/core/bbox.js +1ms    
  vite:resolve 966.80ms @css-render/plugin-bem -> E:/projects/E-fab/node_modules/@css-render/plugin-bem/esm/index.js +0ms
  vite:resolve 966.51ms axios -> E:/projects/E-fab/node_modules/axios/index.js +0ms
  vite:resolve 966.64ms zrender/lib/core/vector.js -> E:/projects/E-fab/node_modules/zrender/lib/core/vector.js +0ms  vite:resolve 966.75ms @unocss/preset-mini/utils -> E:/projects/E-fab/node_modules/@unocss/preset-mini/dist/utils.mjs +0ms
  vite:resolve 966.76ms zrender/lib/graphic/Displayable.js -> E:/projects/E-fab/node_modules/zrender/lib/graphic/Displayable.js +1ms
  vite:resolve 966.51ms zrender/lib/graphic/Group.js -> E:/projects/E-fab/node_modules/zrender/lib/graphic/Group.js 
+0ms
  vite:resolve 966.60ms encode-utf8 -> E:/projects/E-fab/node_modules/encode-utf8/index.js +1s
  vite:resolve 966.61ms call-bind/callBound -> E:/projects/E-fab/node_modules/call-bind/callBound.js +0ms
  vite:resolve 966.34ms zrender/lib/core/LRU.js -> E:/projects/E-fab/node_modules/zrender/lib/core/LRU.js +1ms      
  vite:resolve 966.26ms zrender/lib/contain/line.js -> E:/projects/E-fab/node_modules/zrender/lib/contain/line.js +0ms
  vite:resolve 966.37ms destr -> E:/projects/E-fab/node_modules/destr/dist/index.mjs +0ms
  vite:resolve 966.30ms zrender/lib/core/PathProxy.js -> E:/projects/E-fab/node_modules/zrender/lib/core/PathProxy.js +0ms
  vite:resolve 965.90ms zrender/lib/graphic/Image.js -> E:/projects/E-fab/node_modules/zrender/lib/graphic/Image.js 
+1ms
  vite:resolve 965.73ms @vue/reactivity -> E:/projects/E-fab/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js +0ms
  vite:resolve 965.91ms evtd -> E:/projects/E-fab/node_modules/evtd/es/index.js +0ms
  vite:time 2278.87ms /src/components/svg-icon.vue +2s
  vite:resolve 609.52ms treemate -> E:/projects/E-fab/node_modules/treemate/es/index.js +618ms
  vite:resolve 609.86ms vdirs -> E:/projects/E-fab/node_modules/vdirs/es/index.js +0ms
  vite:resolve 609.31ms @css-render/vue3-ssr -> E:/projects/E-fab/node_modules/@css-render/vue3-ssr/esm/index.js +0ms
  vite:resolve 609.10ms vueuc -> E:/projects/E-fab/node_modules/vueuc/es/index.js +1ms
  vite:resolve 608.55ms date-fns/esm -> E:/projects/E-fab/node_modules/date-fns/esm/index.js +0ms
  vite:resolve 604.52ms async-validator -> E:/projects/E-fab/node_modules/async-validator/dist-web/index.js +0ms    
  vite:resolve 595.79ms zrender/lib/core/event.js -> E:/projects/E-fab/node_modules/zrender/lib/core/event.js +1ms  
  vite:resolve 595.20ms zrender/lib/graphic/LinearGradient.js -> E:/projects/E-fab/node_modules/zrender/lib/graphic/LinearGradient.js +0ms
  vite:resolve 594.97ms zrender/lib/contain/text.js -> E:/projects/E-fab/node_modules/zrender/lib/contain/text.js +0ms
  vite:resolve 595.11ms object-inspect -> E:/projects/E-fab/node_modules/object-inspect/index.js +622ms
  vite:resolve 594.61ms ufo -> E:/projects/E-fab/node_modules/ufo/dist/index.mjs +1ms
  vite:resolve 594.64ms zrender/lib/core/Eventful.js -> E:/projects/E-fab/node_modules/zrender/lib/core/Eventful.js 
+0ms
  vite:resolve 594.56ms zrender/lib/contain/quadratic.js -> E:/projects/E-fab/node_modules/zrender/lib/contain/quadratic.js +0ms
  vite:resolve 594.33ms zrender/lib/contain/util.js -> E:/projects/E-fab/node_modules/zrender/lib/contain/util.js +0ms
  vite:resolve 593.96ms zrender/lib/tool/morphPath.js -> E:/projects/E-fab/node_modules/zrender/lib/tool/morphPath.js +1ms
  vite:resolve 380.02ms zrender/lib/tool/parseSVG.js -> E:/projects/E-fab/node_modules/zrender/lib/tool/parseSVG.js 
+385ms
  vite:resolve 379.95ms zrender/lib/core/platform.js -> E:/projects/E-fab/node_modules/zrender/lib/core/platform.js 
+1ms
  vite:resolve 380.04ms @emotion/hash -> E:/projects/E-fab/node_modules/@emotion/hash/dist/hash.browser.esm.js +0ms 
  vite:resolve 379.02ms zrender/lib/core/curve.js -> E:/projects/E-fab/node_modules/zrender/lib/core/curve.js +0ms  
  vite:resolve 507.47ms date-fns-tz/esm/formatInTimeZone -> E:/projects/E-fab/node_modules/date-fns-tz/esm/formatInTimeZone/index.js +510ms
  vite:resolve 506.98ms zrender/lib/core/timsort.js -> E:/projects/E-fab/node_modules/zrender/lib/core/timsort.js +0ms
  vite:resolve 506.79ms @intlify/vue-devtools -> E:/projects/E-fab/node_modules/@intlify/vue-devtools/dist/vue-devtools.mjs +1ms
  vite:resolve 506.71ms has-symbols -> E:/projects/E-fab/node_modules/has-symbols/index.js +899ms
  vite:resolve 506.34ms zrender/lib/contain/polygon.js -> E:/projects/E-fab/node_modules/zrender/lib/contain/polygon.js +0ms
  vite:resolve 506.31ms @juggle/resize-observer -> E:/projects/E-fab/node_modules/@juggle/resize-observer/lib/exports/resize-observer.js +1ms
  vite:resolve 505.75ms zrender/lib/core/WeakMap.js -> E:/projects/E-fab/node_modules/zrender/lib/core/WeakMap.js +0ms
  vite:resolve 505.84ms zrender/lib/core/dom.js -> E:/projects/E-fab/node_modules/zrender/lib/core/dom.js +0ms      
  vite:resolve 347.75ms function-bind -> E:/projects/E-fab/node_modules/function-bind/index.js +456ms
  vite:resolve 347.82ms @unocss/preset-mini/rules -> E:/projects/E-fab/node_modules/@unocss/preset-mini/dist/rules.mjs +455ms
  vite:resolve 348.01ms zrender/lib/graphic/shape/Rect.js -> E:/projects/E-fab/node_modules/zrender/lib/graphic/shape/Rect.js +0ms
  vite:resolve 348.12ms date-fns/_lib/cloneObject/index.js -> E:/projects/E-fab/node_modules/date-fns/_lib/cloneObject/index.js +1ms
  vite:resolve 348.17ms zrender/lib/graphic/helper/parseText.js -> E:/projects/E-fab/node_modules/zrender/lib/graphic/helper/parseText.js +0ms
  vite:resolve 68.90ms zrender/lib/animation/Animator.js -> E:/projects/E-fab/node_modules/zrender/lib/animation/Animator.js +70ms
  vite:resolve 191.96ms @unocss/preset-mini/theme -> E:/projects/E-fab/node_modules/@unocss/preset-mini/dist/theme.mjs +194ms
  vite:resolve 192.16ms has -> E:/projects/E-fab/node_modules/has/src/index.js +265ms
  vite:resolve 192.26ms @intlify/message-compiler -> E:/projects/E-fab/node_modules/@intlify/message-compiler/dist/message-compiler.mjs +0ms
  vite:resolve 192.18ms date-fns/format/index.js -> E:/projects/E-fab/node_modules/date-fns/format/index.js +1ms    
  vite:resolve 192.27ms date-fns/_lib/toInteger/index.js -> E:/projects/E-fab/node_modules/date-fns/_lib/toInteger/index.js +0ms
  vite:resolve 203.34ms @unocss/preset-mini/variants -> E:/projects/E-fab/node_modules/@unocss/preset-mini/dist/variants.mjs +241ms
  vite:resolve 203.58ms date-fns/_lib/getTimezoneOffsetInMilliseconds/index.js -> E:/projects/E-fab/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds/index.js +1ms
  vite:resolve 203.89ms @intlify/devtools-if -> E:/projects/E-fab/node_modules/@intlify/devtools-if/dist/devtools-if.mjs +0ms
  vite:resolve 204.08ms zrender/lib/canvas/graphic.js -> E:/projects/E-fab/node_modules/zrender/lib/canvas/graphic.js +0ms
  vite:deps ✨ static imports crawl ended +5s
  vite:resolve 118.90ms zrender/lib/tool/parseXML.js -> E:/projects/E-fab/node_modules/zrender/lib/tool/parseXML.js 
+137ms
  vite:resolve 68.55ms zrender/lib/graphic/shape/Circle.js -> E:/projects/E-fab/node_modules/zrender/lib/graphic/shape/Circle.js +78ms
  vite:resolve 31.58ms zrender/lib/graphic/shape/Ellipse.js -> E:/projects/E-fab/node_modules/zrender/lib/graphic/shape/Ellipse.js +43ms
  vite:resolve 12.79ms zrender/lib/graphic/shape/Sector.js -> E:/projects/E-fab/node_modules/zrender/lib/graphic/shape/Sector.js +23ms
  vite:resolve 13.60ms zrender/lib/graphic/shape/Ring.js -> E:/projects/E-fab/node_modules/zrender/lib/graphic/shape/Ring.js +16ms
  vite:resolve 9.79ms zrender/lib/graphic/shape/Polygon.js -> E:/projects/E-fab/node_modules/zrender/lib/graphic/shape/Polygon.js +13ms
  vite:resolve 9.90ms zrender/lib/graphic/shape/Polyline.js -> E:/projects/E-fab/node_modules/zrender/lib/graphic/shape/Polyline.js +12ms
  vite:resolve 10.89ms zrender/lib/graphic/shape/Line.js -> E:/projects/E-fab/node_modules/zrender/lib/graphic/shape/Line.js +22ms
  vite:resolve 10.67ms zrender/lib/graphic/shape/BezierCurve.js -> E:/projects/E-fab/node_modules/zrender/lib/graphic/shape/BezierCurve.js +12ms
  vite:resolve 10.96ms zrender/lib/graphic/shape/Arc.js -> E:/projects/E-fab/node_modules/zrender/lib/graphic/shape/Arc.js +11ms
  vite:resolve 7.76ms zrender/lib/graphic/CompoundPath.js -> E:/projects/E-fab/node_modules/zrender/lib/graphic/CompoundPath.js +9ms
  vite:resolve 7.07ms zrender/lib/graphic/RadialGradient.js -> E:/projects/E-fab/node_modules/zrender/lib/graphic/RadialGradient.js +15ms
  vite:resolve 10.45ms zrender/lib/core/OrientedBoundingRect.js -> E:/projects/E-fab/node_modules/zrender/lib/core/OrientedBoundingRect.js +20ms
  vite:resolve 9.99ms zrender/lib/core/Point.js -> E:/projects/E-fab/node_modules/zrender/lib/core/Point.js +11ms   
  vite:resolve 9.53ms zrender/lib/graphic/IncrementalDisplayable.js -> E:/projects/E-fab/node_modules/zrender/lib/graphic/IncrementalDisplayable.js +10ms
  vite:resolve 11.28ms zrender/lib/graphic/helper/subPixelOptimize.js -> E:/projects/E-fab/node_modules/zrender/lib/graphic/helper/subPixelOptimize.js +12ms
  vite:deps deps bundled in 5583.95ms +758ms
  vite:optimize-deps load E:/projects/E-fab/node_modules/.vite/deps/qs.js +14s
  vite:deps ✨ optimized dependencies unchanged +14ms
  vite:load 5711.52ms [plugin] /node_modules/.vite/deps/qs.js?v=06245ce0 +5s
  vite:import-analysis 1.29ms [1 imports rewritten] node_modules\.vite\deps\qs.js?v=06245ce0 +5s
  vite:transform 2.05ms /node_modules/.vite/deps/qs.js?v=06245ce0 +5s
  vite:time 5576.68ms /node_modules/.vite/deps/qs.js?v=06245ce0 +3s
  vite:cache [memory] /node_modules/.vite/deps/chunk-HUBM7RA2.js?v=f053ff57 +6s
  vite:time 1.52ms /node_modules/.vite/deps/qs.js.map +35ms

Validations

laterdays commented 1 year ago

I don't know at what point, it will become very slow, maybe 6-10s to render the page

bluwy commented 1 year ago

We're currently tracking similar issues at https://github.com/vitejs/vite/issues/7608 and https://github.com/vitejs/vite/issues/1309