aidenybai / million

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

TypeError: (0 , s.AI) is not a function #963

Closed jahirfiquitiva closed 4 months ago

jahirfiquitiva commented 5 months ago

What version of million are you using?

3.0.3

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

Vercel

What package manager are you using?

yarn

What operating system are you using?

Mac

What browser are you using?

Arc

Describe the Bug

During build, I get this error:

 ⚠ Using edge runtime on a page currently disables static generation for that page
   Collecting page data  .TypeError: (0 , s.AI) is not a function
    at 90141 (/Users/jahir/dev/jahir/website/.next/server/chunks/144.js:492:873)
    at t (/Users/jahir/dev/jahir/website/.next/server/webpack-runtime.js:1:127)
    at 17222 (/Users/jahir/dev/jahir/website/.next/server/chunks/144.js:378:423)
    at Function.t (/Users/jahir/dev/jahir/website/.next/server/webpack-runtime.js:1:127)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async collectGenerateParams (/Users/jahir/dev/jahir/website/node_modules/next/dist/build/utils.js:919:21)
    at async /Users/jahir/dev/jahir/website/node_modules/next/dist/build/utils.js:1138:17
    at async Span.traceAsyncFn (/Users/jahir/dev/jahir/website/node_modules/next/dist/trace/trace.js:151:20)

> Build error occurred
Error: Failed to collect page data for /_not-found
    at /Users/jahir/dev/jahir/website/node_modules/next/dist/build/utils.js:1258:15
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  type: 'Error'
}

not sure what could be causing it

What's the expected result?

Build completed successfully

Link to Minimal Reproducible Example

https://github.com/jahirfiquitiva/jahir.dev/pull/73

Participation

github-actions[bot] commented 5 months ago

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

Aslemammad commented 4 months ago

Getting this error after cloning and pnpm dev:

image

jahirfiquitiva commented 4 months ago

@Aslemammad so weird that it's trying to import ./generated from node_modules/contentlayer

contentlayer/generated should be an alias for the "./.contentlayer/generated" folder as per tsconfig.json

I'm not sure if it's an issue with pnpm, I use yarn with my project.

If anything, try running yarn contentlayer build before running the dev script.

By the way, this issue has been fixed by changing the million config to:

const millionConfig = {
  mute: true,
  auto: { rsc: true },
  rsc: true,
};

as suggested in this comment

Aslemammad commented 4 months ago

I'm getting so many more errors like all the images in the /assets/images/ dir not being resolved, or during the build I get this

image

Anyway, the issue you're facing would be fixed by #959

jahirfiquitiva commented 4 months ago

@Aslemammad it seems as if it wasn't taking any of the paths aliases set up in tsconfig.json ... so weird

github-actions[bot] commented 4 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days.