#super slow developer environment

12 messages · Page 1 of 1 (latest)

deft zealot
#

I created a new project and npm run dev takes >30s to compile

❯ npx create-next-app@latest nextjs-blog
Need to install the following packages:
[email protected]
Ok to proceed? (y) y
✔ Would you like to use TypeScript? … No / Yes
✔ Would you like to use ESLint? … No / Yes
✔ Would you like to use Tailwind CSS? … No / Yes
✔ Would you like to use `src/` directory? … No / Yes
✔ Would you like to use App Router? (recommended) … No / Yes
✔ Would you like to customize the default import alias (@/*)? … No / Yes
✔ What import alias would you like configured? … @/*
Creating a new Next.js app in /Users/jawaugh/labs/scratch/fixme/nextjs-blog.

Using npm.

Initializing project with template: app-tw 


Installing dependencies:
- react
- react-dom
- next

Installing devDependencies:
- typescript
- @types/node
- @types/react
- @types/react-dom
- autoprefixer
- postcss
- tailwindcss
- eslint
- eslint-config-next


added 360 packages, and audited 361 packages in 24s

128 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
Initialized a git repository.

Success! Created nextjs-blog at /Users/jawaugh/labs/scratch/fixme/nextjs-blog

❯ 
❯ ls
nextjs-blog
❯ cd nextjs-blog
ls                                                                                                                                                                                 
❯ ls
README.md          next-env.d.ts      node_modules       package.json       public             tsconfig.json
app                next.config.mjs    package-lock.json  postcss.config.js  tailwind.config.ts
❯ npm run dev

> [email protected] dev
> next dev

   ▲ Next.js 14.1.0
   - Local:        http://localhost:3000

 ✓ Ready in 6s
 ○ Compiling / ...
 ✓ Compiled / in 27.9s (510 modules)
 ✓ Compiled in 2.6s (240 modules)
 ○ Compiling /favicon.ico ...
 ✓ Compiled /favicon.ico in 4.4s (515 modules)

My first development environment took 30s, and even things like favicon.ico pulls 515 modules?

hollow snowBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

deft zealot
#
 ✓ Ready in 6s
 ○ Compiling / ...
 ✓ Compiled / in 27.9s (510 modules)
 ✓ Compiled in 2.6s (240 modules)
 ○ Compiling /favicon.ico ...
 ✓ Compiled /favicon.ico in 4.4s (515 modules)

These lines feel terrible. Why does it take 28 seconds to open just a default simple page?
How is it possible that a favicon requires 515 modules to load?

I don't remember this being the case ~1 year ago when i first started using next - and seems to be an issue that was introduced sometime since? I'm using the standard create next app, so i feel like this is a pure bug inside of next?

dreamy mist
#

Did you try with turbo pack?

#

In your package.json try changing the dev to this

{
"scripts": {
"dev": "next dev --turbo",
"build": "next build",
"start": "next start",
"lint": "next lint"
}
}

deft zealot
#

yes i tried, a little better, but still very slow.

dreamy mist
#

Considering it’s a fresh install it’s most likely your computer speed or something else in your dev environment. I reproduced your steps and it’s compiling the pages in 0.8s on an i7 imac

deft zealot
#

I'm on an M2 macbook air.
nothing else running.

I've got 2 other friends with M2s right now with me who see the same thing.

Are you saying you don't see "510 modules" on this?

dreamy mist
#

i just tested a massive next project on an old 2015 mbp i5:

   ▲ Next.js 14.0.4
   - Local:        http://localhost:3000
   - Environments: .env

 ✓ Ready in 12.8s
 ○ Compiling / ...
 ✓ Compiled / in 10.3s (2611 modules)
 ✓ Compiled in 1265ms (1294 modules)
 ○ Compiling /favicon.ico ...
 ✓ Compiled /favicon.ico in 2.3s (1345 modules)
#

14.1.0 is definitely a bit slower for me in dev

 ○ Compiling / ...
 ✓ Compiled / in 20.2s (2636 modules)

but with turbo :

 ○ Compiling / ...
 ✓ Compiled / in 11.1s
deft zealot
#

yeah, this is way too slow imo - the 1000s of modules for "favicon.ico" feels like a bug

dreamy mist
#

It’s not 1000s of modules for a Favicon… that number is cumulative of everything so far