Yuuyuuyu
Yuuyuuyu
CDCloudflare Developers
Created by Yuuyuuyu on 3/23/2025 in #pages-help
Production deployment fails but Preview deployment works.
Required info: pages.dev: connor-jones-web.pages.dev deployment-id: 80a172af-3025-4b90-b2dd-c25e3e7d5feb <- Preview (successful) 64b99836-630d-4091-aa52-8c0fff442267 <- Production (fail) d0e99cbc-06fd-4347-bccc-d453c612f6d7 <- Production (fail) cd64d813-79b6-465d-957b-1b533a0a01e1 <- Production (fail) Account ID: efb10975c64e4c47e65d5ac6b0e541ee I'm literally pulling my hair out dealing with Cloudflare pages. Nothing works seamlessly there's always SOME caveat that breaks the deployment that isn't documented. It's like road block after road block. Falling behind on actual development trying to get this deployment working... The preview build deploys when I push to my development branch, it clones the files from my repo and simply runs the cf-build.sh script that I attached. Nothing is different from master and development other than the variable NODE_ENV. Production build (64b99836-630d-4091-aa52-8c0fff442267) fails when executing:
13:47:05.712 > rimraf _site .cache node_modules/.cache
13:47:05.712
13:47:05.719 sh: 1: rimraf: not found
13:47:05.735 Failed: Error while executing user command. Exited with error code: 127
13:47:05.745 Failed: build command exited with code: 1
13:47:06.806 Failed: error occurred while running build command
13:47:05.712 > rimraf _site .cache node_modules/.cache
13:47:05.712
13:47:05.719 sh: 1: rimraf: not found
13:47:05.735 Failed: Error while executing user command. Exited with error code: 127
13:47:05.745 Failed: build command exited with code: 1
13:47:06.806 Failed: error occurred while running build command
It could find rimraf in preview since it's IN THE package.json which the install script installs with npm install but production is special and decides that after running npm install, rimraf isn't there. Files are ALL the same, admin settings are all the same other than NODE_ENV being different production or development. I've attached build logs for both the successful preview build and the failing production build.
8 replies