Next@12 failing to build sass on Netlify. Works on Vercel and locally

Hello folks!

I’m trying to migrate from nextjs@11 to 12, and I fail to compile sass on Netlify.
It works locally. It works on Vercel. But SASS is not compiled nor bundled to CSS when deploying to Netlify.

Is there somebody who can help me debug this together?
Do you have an idea where to look?

Thanks a lot :pray:

Hey there, @Louis :wave:

Thanks so much for reaching out! We have taken a look at what you have shared, but would like to reproduce this fully on our end to understand what obstacle you are encountering. Could you share your full project repo? If not, could you share a reproduction repo? Thanks!

Hi Hillary! Thanks a lot. Sure thing! Have you got a Github username I can share the repo with?

Hey there, @Louis :wave:

Sure thing! I will be offline for Saturday and Sunday, so please add my teammate Hrishikesh-K, who will look into this further.

Thanks!

Thanks, @hillary :pray: I invited your teammate Hrishikesh-K

1 Like

Thanks so much for confirming. He will follow up on this thread with more information once he has it.

Hey there, @Louis :wave:

Just wanted to follow up here to close the conversation loop. It looks like Hrishikesh has been assisting you via email. We will continue the conversation there.

Thanks!

Hi @hillary :wave:

Since my initial message on March 31 above, the site is not showing CSS when hosted on Netlify.

I waited for several weeks, and now the email support answered yesterday and said " If you have any follow-up questions, we kindly ask that you post them over in the Netlify Support Forum."

Hey there, @Louis :wave:

Thanks for your patience here, and my apologies for the back and forth on this. I assure you we are invested in your project being successful!

I know you mentioned that your build works on vercel and not netlify-- is there a difference in configuration? If so, a good place to start is debugging your build output.

Additionally, have you confirmed that all of your versions are the same? You can use this link for more info on how to check: [Support Guide] Debugging Netlify site builds. My apologies for not sending this to you earlier.

Hrishikesh-K Helped me solve the problem over email support.

The issue was because the Asset Optimisation feature is not compatible with Next.js.

That’s too bad that the build plugin is not able to know if asset optimisation is enabled or not, and display a potential warning during the build.