ReferenceError Help in next13
Attached is my error as well as my
next.config.js
file. I have no idea what this error means and I'm having trouble finding a solution online.12 Replies
You can't mix cjs and mjs, change the
module.exports =
to export default
.
module.exports
is how you export in cjs format and export default
is for mjs.which is typically recommended for a nextjs project?
Also thank you for the response
mjs
ok because my tailwind config and postcss config are all module .exports
and now its giving me a hard time for those
for postcss make it .cjs
tailwind you can use .ts or also just change it to .cjs
if you change it to ts make sure you use
export default
ok it says it doesn't like postcss being .cjs. How can I fix this new error while keeping it .cjs
also should type: module be in my package.json?
yes
ok i renamed the css file to .cjs extension
testing...
it works! thanks
appreciate it