Help with webpack error
Hello! Could anyone that gets nextjs help me understand this error I get when running
npm run build
:
It only happens when I try to link a component from my /app/components directory into my page.tsx.
npm run dev
works fine with no errors, and deploying on vercel also works fine, it's just building locally that's the issue.16 Replies
Can you send your app/page.tsx file
here you are!
Can you sure the newbutton file too
i assume you're using nextjs?
uh
yeah
I've used react on a work system before and didn't have this problem
i built a new next app with your code and it seems to build fine for me
did you define your own webpack config or something
my friend I couldn't tell you what webpack is
nextjs uses turbopack to build for dev and webpack for prod so might be that
how can I check the config
if this is all your code can you try making a new next app with
npx create-next-app
and see if that builds
there's usually a webpack.config.jshuh
I can't find it in my project's directory
yeah leave it then, something's wrong with your dependencies most probably
Solution
i'd try creating a new app and seeing if the issue persists
ok sounds good
yeah nuking the project and doing it again fixed it
thank you
classic