aidenybai / million

Optimize React performance and make your React 70% faster in minutes, not months.
https://million.dev
MIT License
15.87k stars 554 forks source link

[BUG] Module not found: Can't resolve for client components in NextJS 14 #1064

Open SalahAdDin opened 6 days ago

SalahAdDin commented 6 days ago

What version of million are you using?

1.0.0-faire.6

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

pnpm

What operating system are you using?

Manjaro Linux

What browser are you using?

Firefox

Describe the Bug

When running our NextJS project after installing Million Lint, the site is not loaded and the console gives us the following issue:

> global-web-fe@1.6.0 dev /home/luisalaguna/Projects/TRT/twe_fe_next
> next dev

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

 ✓ Starting...

 ⚡ Million Lint v1.0.0-faire.6
 - Ingest server: http://localhost:42423

 ✓ Ready in 0.15ms
 ✓ Ready in 4.8s
 ✓ Compiled /src/middleware in 182ms (96 modules)
 ○ Compiling /[locale] ...
 ⨯ ./src/app/_components/navigation/Header/Header.tsx:79:75
Module not found: Can't resolve 'src/app/_components/navigation/Header/Header.tsx'
  77 |     }
  78 |   } else if (module.hot) {
> 79 |     module.hot.accept("src/app/_components/navigation/Header/Header.tsx", () => {
     |                                                                           ^
  80 |       _c();
  81 |     });
  82 |   }

https://nextjs.org/docs/messages/module-not-found
 ⨯ ./src/app/_components/navigation/Header/Header.tsx:79:75
Module not found: Can't resolve 'src/app/_components/navigation/Header/Header.tsx'
  77 |     }
  78 |   } else if (module.hot) {
> 79 |     module.hot.accept("src/app/_components/navigation/Header/Header.tsx", () => {
     |                                                                           ^
  80 |       _c();
  81 |     });
  82 |   }

https://nextjs.org/docs/messages/module-not-found
 GET /en 500 in 10244ms

This only happen to client components.

What's the expected result?

It should run the project properly.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/nextjs-gunq6c

Participation

github-actions[bot] commented 6 days ago

Thanks for opening this issue! A maintainer will review it soon.