SCSS file being compiled as JS and (obviously) erroring on Nextjs "Collecting page data" step
I am quite stuck.
Trying to get PayloadCMS running within NextJS by using the
@payloadcms/next-payload
package. All seems OK but when I run a build I get an error on the cjs loader not understanding SCSS syntax. In dev mode all is fine.
I am not sure if the issue is even related to the payload package. How can the cjs loader think a scss file is js?
Having a hard time understanding how this can be happening, and how to prevent it.
Probably hard to see why based off of this info but pls help me look into the right direction.
Thanks in advance!
Nextjs build output:
2 Replies
did you run
npm install sass
?I did, these are all the installed packages:
Kind of lost my mind here.
When moving all the payload files and next pages over to a working example, it still worked...
Copied all the things back over to the original repo... still works but no obvious diff showing what caused the fix..
Anyways, thanks for the help