Deploy preview works not production

I saw other forums that this can be about the split testing, but i have truned it off!

So my production does not work

https://www.cornerstonejs.org/live-examples/stackBasic.html

same deploy preview works

https://deploy-preview-1536--cornerstone-3d-docs.netlify.app/live-examples/stackbasic


I have noticed though every othe PR gets merged the production get fixed and then on the next PR it gets broken again

Here is our netlify toml

THanks in advance

Seems like a problem with Docusaurus or yoour build process. On the deploy preview, it is building the html files: Deploy details | Deploys | cornerstone-3d-docs | Netlify

For production, that’s not the case: Deploy details | Deploys | cornerstone-3d-docs | Netlify

Netlify is deploying and serving whatever output gets generated by the build. As for why the build is doing what it’s doing, I’m afraid that’s not something we can figure out.

Thanks for the reply. It’s strange because when I run the same command (yarn build:docs) locally, it generates the HTML files. Do you have any insights from your previous experiences with this?

I found that Webpack had a lot to build, causing the process to be terminated midway. However, Netlify didn’t detect the failure and continued with the deployment. To resolve this, I reorganized my Webpack build to process in chunks.

Hi, @sedghi. I want to point out a small but very important error:

Netlify is not the one that did not detect the failure. Netlify only sees the exit code of your build command. If your build command exits with an exit code of 0 that means a successful build. If the exit code is non-zero, it means there was an error and Netlify will cancel the deploy.

This means it was your build code that did not detect the failure. Your build code was then exiting with an exit code of 0. Your build command told Netlify, “No errors. Continue with the deploy.”

So, it was not Netlify not detecting the failure. It was your code not detecting the failure. Your code is required to exit with a non-zero exit code when an error happens.

Again, the failure to detect the error happened in your code, not in Netlify’s. This is important as only you can fix the errors in your code. Netlify cannot fix this as only you control the code that runs during the build. It is you that must make sure your code exits with a non-zero value on errors. Because you did not do this, Netlify had no way to know an error existed.

I just do not want people thinking this is something Netlify can fix. We cannot fix this. This type of error is the responsibility of the developer to fix (because the bug is in their code) and not Netlify (as we cannot control the code you write).