Closed Tigatok closed 8 months ago
Just throwing this out there but typescript, types, eslint - is it safe to move these to the devDependencies section?
@supastore Ah yeah, sorry I saw that and removed those, but didn't clean up the git post. All deps are moved to non-dev if they should be!
Thanks!
Try updating your next.config.js
file to this.
const path = require('path')
/** @type {import('next').NextConfig} */
module.exports = {
reactStrictMode: true,
experimental: {
appDir: true,
},
compiler: {
styledComponents: true,
},
sassOptions: {
includePaths: [path.join(__dirname, 'styles')],
},
modularizeImports: {
'@mui/icons-material': {
transform: '@mui/icons-material/{{member}}',
},
'@mui/material': {
transform: '@mui/material/{{member}}',
}
}
}
That makes things like this, fail for some reason.
./app/State/StateIcon.tsx:10:0 Module not found: Can't resolve '@mui/material/createTheme' 8 | } from "@mui/icons-material"; 9 | import { green, red, blue, orange } from "@mui/material/colors";
10 | import { Avatar, createTheme, ThemeProvider } from "@mui/material";
Hi @Tigatok! This shouldn't be the case anymore.
In the meantime, I will be closing this issue. If this slow dev compile time is still an issue, please feel free create a new bug report.
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
yarn next info yarn run v1.22.19 $ ///node_modules/.bin/next info
Done in 2.03s.
Which area(s) of Next.js are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue
https://codesandbox.io/s/upbeat-lake-tsq3ir?file=/app/list/page.tsx
To Reproduce
I used the
yarn create next-app --experimental-app
command to begin our new version of a project. My dependencies list includes the following:Upon running
yarn dev
, I am experiencing insane long compile times.Describe the Bug
After running
yarn dev
I am experiencing a compile time of around 33.2s. It says it is compiling 23214 modules.It would appear that there is still a delay (>1s) when loading basic page types as well. Attached is a picture of a network tab.
My code is pretty straightforward. The only caveat I can see is that I am using the useRouter() hook. I am using this because NextJS 13 does not support Material UI components. Therefore, I have told my NavBar component to
use client
, pushing them to my newsettings/page.tsx
andlist/page.tsx
.Expected Behavior
Seems like something is going wrong during compile. Whenever I am making a change to the client code, and the fast-refresh executes, I am waiting ~15 seconds to see the changes.
Which browser are you using? (if relevant)
Version 108.0.5359.125 (Official Build) (64-bit)
How are you deploying your application? (if relevant)
yarn dev (using create next app)