-
Notifications
You must be signed in to change notification settings - Fork 29.5k
Description
What version of Next.js are you using?
11.1.2
What version of Node.js are you using?
14.17.6
What browser are you using?
Chrome
What operating system are you using?
macOS
How are you deploying your application?
Vercel
Describe the Bug
After upgrading to next 11, we build times went crazy for our app. In the logs, I see that creating serverless functions is being done, even though we don't have any getInitialProps
or getServerSideProps
, only getStaticProps
.
09:48:25.794 | Done in 225.86s.
09:48:28.652 | Traced Next.js server files in: 2.474s
09:55:55.351 | Created all serverless functions in: 7:26.697 (m:ss.mmm)
09:55:57.857 | Uploading build outputs...
09:56:04.314 | Deploying build outputs...
09:56:47.123 | Build completed. Populating build cache...
After some debugging, I've come to the conclusion that this is only happening if you have localization enabled (we have 3 locales).
I've played around with the nextjs version, and if I use v10, this part
09:55:55.351 | Created all serverless functions in: 7:26.697 (m:ss.mmm)
is skipped.
Expected Behavior
I expect that if none of the pages use getInitialProps
or getServerSideProps
this part of the build should be skipped:
09:48:28.652 | Traced Next.js server files in: 2.474s
09:55:55.351 | Created all serverless functions in: 7:26.697 (m:ss.mmm)
To Reproduce
Since our repo is private, I've created some example repo so you can test it out:
https://github.com/rodilo/next-18n-build-test
of course, since this app is lot smaller (only 2 pages) then our app, creating of serverless functions part of the build is done much faster.