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

Extremely slow startup time (1+ minute) #23504

Closed
mrleblanc101 opened this issue Oct 2, 2023 · 10 comments
Closed

Extremely slow startup time (1+ minute) #23504

mrleblanc101 opened this issue Oct 2, 2023 · 10 comments

Comments

@mrleblanc101
Copy link

Environment


  • Operating System: Darwin
  • Node Version: v20.4.0
  • Nuxt Version: 3.7.4
  • CLI Version: 3.9.0
  • Nitro Version: 2.6.3
  • Package Manager: yarn@1.22.19
  • Builder: -
  • User Config: srcDir, devtools, css, modules, i18n, vite
  • Runtime Modules: @nuxtjs/i18n@8.0.0-rc.4
  • Build Modules: -

Reproduction

https://github.com/mrleblanc101/nuxt-3-starter

Describe the bug

✔ Nitro built in 29121 ms
ℹ Vite client warmed up in 31629ms

Additional context

This seem related to the use of SCSS.
Removing css.preprocessorOptions.scss.additionalData improved the startup time, but not as much as it should be.

Logs

No response

@mrleblanc101
Copy link
Author

mrleblanc101 commented Oct 2, 2023

I think this is slower than our Nuxt 2 Starter template we used.
I can't imagine how slow it will become once we'll have more components.
Which is strange, since Vite.js was supposed to be much faster than Webpack@4.

@manniL
Copy link
Member

manniL commented Oct 2, 2023

FYI: After removing SCSS + preprocessorOptions, I come to a decent starting time.
Also removing preprocessorOptions yields an okay-ish time.

Base Repo:

image

Without preprocessorOptions:
image

Without SCSS and preprocessorOptions:

image

@mrleblanc101
Copy link
Author

Yeah, that's what I was trying to say.
But this compile fine in just a few ms in Webpack 4 and Gulp.
So there seem to be an issue with Nuxt/Vite/Nitro, not sure where but this isn't normal.

@manniL
Copy link
Member

manniL commented Oct 2, 2023

Can you try reproducing this with plain vite and vue?

Possibly related: vitejs/vite#6736 (comment)

@danielroe
Copy link
Member

Possibly also linked: #22116

@TimGuendel
Copy link

TimGuendel commented Oct 4, 2023

Same Problem here.

Without SCSS:
image

With SCSS:
image

https://stackoverflow.com/questions/77214965/adding-global-scss-styles-leads-to-extremely-high-nitro-warm-up-times

@miosenpai
Copy link

I experience similar slowdowns upon including SASS in my project as well (#20533).

@mrleblanc101
Copy link
Author

mrleblanc101 commented Oct 9, 2023

I used create-vue and everything is fast, vite starts under 300ms and the page load in under 2s. https://github.com/mrleblanc101/vue-slow-scss
I'm not 100% sure how Nuxt handle assets under the hood, so maybe my repro is not identical.

@danielroe
Copy link
Member

let's track in #20533.

@danielroe danielroe closed this as not planned Won't fix, can't repro, duplicate, stale Oct 24, 2023
@tranphuocloc070699
Copy link

I do not use scss, i am using tailwindcss , but it also start slow. How to fix it?

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

No branches or pull requests

6 participants