Replies: 2 comments 2 replies
-
@balazsorban44 Has the been any further investigation into this? My real application uses i18n and follows the official Next.js example on how to implement this with middleware. So I stripped back my entire middleware file to be just the following content: // middleware.ts
export { default } from 'next-auth/middleware';
export const config = {
matcher: [ '/admin' ]
}; This produces the following size when running - ƒ Middleware 213 kB If I omit all of the next-auth middleware-related items, and just use middleware for the locale checks, I get the following size: + ƒ Middleware 29.2 kB |
Beta Was this translation helpful? Give feedback.
-
Hi is there any update on this? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Environment
System:
OS: Linux 6.0 Fedora Linux 37 (Workstation Edition)
CPU: (16) x64 AMD Ryzen 7 PRO 5850U with Radeon Graphics
Memory: 18.20 GB / 27.23 GB
Container: Yes
Shell: 5.9 - /usr/bin/zsh
Binaries:
Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v16.14.2/bin/yarn
npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
Watchman: 0.0.0 - /usr/bin/watchman
Browsers:
Chrome: beta
Firefox: 107.0
npmPackages:
next: latest => 13.0.6
next-auth: latest => 4.18.0
react: ^18.2.0 => 18.2.0
Reproduction URL
https://github.com/nextauthjs/next-auth-example
Describe the issue
The default out-of-the-box middleware is about 50KB:
This seems oddly large to me given that the entirety of react + react-dom + nextjs + next-auth comes in at 83.5KB in the same example project.
How to reproduce
Build the example project.
Expected behavior
Smaller bundle size.
Beta Was this translation helpful? Give feedback.
All reactions