I'm starting with next and I get this error on compile when doing `pnpm dev`
Answered
Sloth bear posted this in #help-forum
Sloth bearOP
./src/app/globals.css.webpack[javascript/auto]!=!./node_modules/.pnpm/next@13.5.4_react-dom@18.0.0_react@18.0.0/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[13].oneOf[12].use[2]!./node_modules/.pnpm/next@13.5.4_react-dom@18.0.0_react@18.0.0/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[13].oneOf[12].use[3]!./src/app/globals.css
TypeError: Cannot read properties of undefined (reading 'config')pd: I haven't touched anything in the project, I just created it.
Answered by Japanese flying squid
i had this happen too, running pnpm upgrade after install seemed to fix it
12 Replies
Giant panda
What is the
dev script in your package.json?@Giant panda What is the `dev` script in your `package.json`?
Sloth bearOP
it is
next devGiant panda
Then my suspicion was wrong. Don't have any ideas what it might be.
@Giant panda Then my suspicion was wrong. Don't have any ideas what it might be.
Sloth bearOP
it seems that the error is in the Config type of the tailwind config file, it does not seem to find anything through
import type { Config } from 'tailwindcss'.Sloth bearOP
I don't know what is wrong with the tailwind types when creating the project, my solution for the moment was to create the project from 0 and install tailwind manually, but I think this does not solve my problem.
Blanc de Hotot
When you installed Next.js, did you select Tailwind? Also, are you using AppRouter? I've faced this issue before but can't remember how I resolved it. Could you provide more information about your Next.js installation process?
Blanc de Hotot
Great 😃
Can you push your project on GitHub repo and send the link here
Can you push your project on GitHub repo and send the link here
btw you can try to install tailwind or if you are using a special tailwind package e.g (twMerge, etc...) You must install them first.
Also try to use pnpm install
Also try to use pnpm install
Blanc de Hotot
Please make sure you already installed postcss and using it right
Japanese flying squid
i had this happen too, running pnpm upgrade after install seemed to fix it
Answer
@Japanese flying squid i had this happen too, running pnpm upgrade after install seemed to fix it
Sloth bearOP
apparently it was this, I was using version 8.6.7, I updated to 8.8 and now the project was created without problems.