Netlify is deleting my built CSS files (Middleman, PostCSS, Tailwind)

Netlify Site Name: https://highwind-staging.netlify.app/

I am building this site with Middleman (https://middlemanapp.com) using Tailwind for CSS (https://tailwindcss.com). The problem looks like when I build on Netlify, Netlify takes an extra step to remove my processed CSS file. I have run the exact same build command locally and the output is identical to the Netlify output except locally there is no extra step that removes my processed stylesheet. Netlify’s asset processing is disabled for my site. I am using PurgeCSS so the resulting built file is 18k which should be fine for Netlify’s CDN. I have cleared the build cache so that dependencies are up to date. I cannot find anything in the documentation to explain why Netlify is choosing to delete my build products. Here is the build output I get from Netlify. Search for ‘–>’ to go to the line which I believe is causing the problem. Thank you.

10:47:20 AM: Waiting for other deploys from your team to complete
10:48:08 AM: Build ready to start
10:48:10 AM: build-image version: 3571f0130496395a23bffe9820bc78b4f73a6234
10:48:10 AM: build-image tag: v3.7.0
10:48:10 AM: buildbot version: 3d5ccbdc3ba752f1ea34e44e85b7e01dd505414c
10:48:10 AM: Fetching cached dependencies
10:48:10 AM: Starting to download cache of 286.5MB
10:48:13 AM: Finished downloading cache in 2.764687572s
10:48:13 AM: Starting to extract cache
10:48:25 AM: Finished extracting cache in 12.059151853s
10:48:25 AM: Finished fetching cache in 14.944111274s
10:48:25 AM: Starting to prepare the repo for build
10:48:26 AM: Preparing Git Reference refs/heads/master
10:48:27 AM: Parsing package.json dependencies
10:48:28 AM: Different publish path detected, going to use the one specified in the Netlify configuration file: ‘build’ versus ‘build/’ in the Netlify UI
10:48:29 AM: Starting build script
10:48:29 AM: Installing dependencies
10:48:29 AM: Python version set to 2.7
10:48:29 AM: Started restoring cached node version
10:48:33 AM: Finished restoring cached node version
10:48:33 AM: Attempting node version ‘15.12.0’ from .nvmrc
10:48:34 AM: v15.12.0 is already installed.
10:48:35 AM: Now using node v15.12.0 (npm v7.6.3)
10:48:35 AM: Started restoring cached build plugins
10:48:35 AM: Finished restoring cached build plugins
10:48:36 AM: Attempting ruby version 2.6.2, read from environment
10:48:37 AM: Using ruby version 2.6.2
10:48:37 AM: Using bundler version 1.17.2 from Gemfile.lock
10:48:39 AM: Successfully installed bundler-1.17.2
10:48:39 AM: 1 gem installed
10:48:39 AM: Using PHP version 5.6
10:48:39 AM: Started restoring cached ruby gems
10:48:39 AM: Finished restoring cached ruby gems
10:48:39 AM: Started restoring cached node modules
10:48:39 AM: Finished restoring cached node modules
10:48:40 AM: Started restoring cached go cache
10:48:42 AM: Finished restoring cached go cache
10:48:42 AM: Installing Go version 1.12
10:48:42 AM: unset GOOS;
10:48:42 AM: unset GOARCH;
10:48:42 AM: export GOROOT=’/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64’;
10:48:42 AM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:${PATH}";
10:48:42 AM: go version >&2;
10:48:42 AM: export GIMME_ENV=’/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env’;
10:48:42 AM: go version go1.12 linux/amd64
10:48:42 AM: Installing missing commands
10:48:42 AM: Verify run directory
10:48:44 AM: ​
10:48:44 AM: ────────────────────────────────────────────────────────────────
10:48:44 AM: Netlify Build
10:48:44 AM: ────────────────────────────────────────────────────────────────
10:48:44 AM: ​
10:48:44 AM: ❯ Version
10:48:44 AM: @netlify/build 9.11.2
10:48:44 AM: ​
10:48:44 AM: ❯ Flags
10:48:44 AM: apiHost: api.netlify.com
10:48:44 AM: cacheDir: /opt/build/cache
10:48:44 AM: deployId: 6058adf8e1c5d0000756ca0a
10:48:44 AM: mode: buildbot
10:48:44 AM: testOpts:
10:48:44 AM: silentLingeringProcesses: ‘’
10:48:44 AM: ​
10:48:44 AM: ❯ Current directory
10:48:44 AM: /opt/build/repo
10:48:44 AM: ​
10:48:44 AM: ❯ Config file
10:48:44 AM: No config file was defined: using default values.
10:48:44 AM: ​
10:48:44 AM: ❯ Context
10:48:44 AM: production
10:48:44 AM: ​
10:48:44 AM: ────────────────────────────────────────────────────────────────
10:48:44 AM: 1. Build command from Netlify app
10:48:44 AM: ────────────────────────────────────────────────────────────────
10:48:44 AM: ​
10:48:44 AM: $ middleman build --verbose --environment staging
10:48:46 AM: == Activating: file_watcher
10:48:46 AM: == Activating: front_matter
10:48:46 AM: == Activating: data
10:48:46 AM: == Activating: inline_url_rewriter
10:48:46 AM: == Activating: sitemap_ondisk
10:48:46 AM: == Activating: sitemap_import
10:48:46 AM: == Activating: sitemap_endpoint
10:48:46 AM: == Activating: sitemap_proxies
10:48:46 AM: == Activating: sitemap_redirects
10:48:46 AM: == Activating: sitemap_move_files
10:48:46 AM: == Activating: sitemap_ignore
10:48:46 AM: == Activating: external_helpers
10:48:46 AM: == Activating: erb_renderer
10:48:46 AM: == Activating: coffee_renderer
10:48:46 AM: == Activating: haml_renderer
10:48:46 AM: == Activating: sass_renderer
10:48:46 AM: == Activating: markdown_renderer
10:48:46 AM: == Failed Activation liquid_renderer : cannot load such file – liquid
10:48:46 AM: == Failed Activation slim_renderer : cannot load such file – slim
10:48:46 AM: == Failed Activation less_renderer : cannot load such file – less
10:48:46 AM: == Failed Activation stylus_renderer : cannot load such file – stylus
10:48:46 AM: == Activating: default_helpers
10:48:46 AM: == Activating: lorem
10:48:46 AM: == Activating: routing
10:48:46 AM: == Activating: collections
10:48:46 AM: == Change (#<Set: {:source}>): layouts/layout.erb
10:48:46 AM: == Change (#<Set: {:source}>): layouts/unauthorized.erb
10:48:46 AM: == Change (#<Set: {:source}>): employee-input.html.erb
10:48:46 AM: == Change (#<Set: {:source}>): course-session.html.erb
10:48:46 AM: == Change (#<Set: {:source}>): javascripts/training_schedule.js.erb
10:48:46 AM: == Change (#<Set: {:source}>): javascripts/session.js
10:48:46 AM: == Change (#<Set: {:source}>): javascripts/site.js.erb
10:48:46 AM: == Change (#<Set: {:source}>): javascripts/localization.js
10:48:46 AM: == Change (#<Set: {:source}>): javascripts/employee_input.js.erb
10:48:46 AM: == Change (#<Set: {:source}>): javascripts/course_session.js.erb
10:48:46 AM: == Change (#<Set: {:source}>): javascripts/util.js
10:48:46 AM: == Change (#<Set: {:source}>): javascripts/flash.js
10:48:46 AM: == Change (#<Set: {:source}>): javascripts/login.js.erb
10:48:46 AM: == Change (#<Set: {:source}>): javascripts/libs/underscore-min.js
10:48:46 AM: == Change (#<Set: {:source}>): javascripts/libs/dayjs_locales/es.js
10:48:46 AM: == Change (#<Set: {:source}>): javascripts/libs/dayjs_locales/en.js
10:48:46 AM: == Change (#<Set: {:source}>): javascripts/libs/dayjs.min.js
10:48:46 AM: == Change (#<Set: {:source}>): index.html.erb
10:48:46 AM: == Change (#<Set: {:source}>): stylesheets/site.css
10:48:46 AM: == Change (#<Set: {:source}>): images/favicon.ico
10:48:46 AM: == Change (#<Set: {:source}>): images/hazard_triangle.svg
10:48:46 AM: == Change (#<Set: {:source}>): images/exit_door.svg
10:48:46 AM: == Change (#<Set: {:source}>): images/.keep
10:48:46 AM: == Change (#<Set: {:source}>): images/background.png
10:48:46 AM: == Change (#<Set: {:source}>): images/login_header.jpg
10:48:46 AM: == Change (#<Set: {:source}>): images/man_at_whiteboard.svg
10:48:46 AM: == Change (#<Set: {:source}>): images/logo_black.png
10:48:46 AM: == Change (#<Set: {:source}>): images/company_banner_white.png
10:48:46 AM: == Change (#<Set: {:source}>): training-schedule.html.erb
10:48:46 AM: == Change (#<Set: {:source}>): login.html.erb
10:48:46 AM: == Rebuilding resource list
10:48:46 AM: == Reading: Local config: config.rb
10:48:46 AM: == Activating: livereload
10:48:46 AM: == Activating: external_pipeline
10:48:46 AM: == Executing: npx postcss ./source/stylesheets/site.css -o ./build/stylesheets/styles.css
10:48:54 AM: == Requesting resource list rebuilding: first_run_change_page
10:48:54 AM: == Requesting resource list rebuilding: first_run_change_page
10:48:54 AM: == Requesting resource list rebuilding: first_run_change_page
10:48:54 AM: Loaded extensions:
10:48:54 AM: == Extension: file_watcher
10:48:54 AM: == Extension: front_matter
10:48:54 AM: == Extension: data
10:48:54 AM: == Extension: inline_url_rewriter
10:48:54 AM: == Extension: sitemap_ondisk
10:48:54 AM: == Extension: sitemap_import
10:48:54 AM: == Extension: sitemap_endpoint
10:48:54 AM: == Extension: sitemap_proxies
10:48:54 AM: == Extension: sitemap_redirects
10:48:54 AM: == Extension: sitemap_move_files
10:48:54 AM: == Extension: sitemap_ignore
10:48:54 AM: == Extension: external_helpers
10:48:54 AM: == Extension: erb_renderer
10:48:54 AM: == Extension: coffee_renderer
10:48:54 AM: == Extension: haml_renderer
10:48:54 AM: == Extension: sass_renderer
10:48:54 AM: == Extension: markdown_renderer
10:48:54 AM: == Extension: default_helpers
10:48:54 AM: == Extension: lorem
10:48:54 AM: == Extension: routing
10:48:54 AM: == Extension: collections
10:48:54 AM: == Extension: livereload
10:48:54 AM: == Extension: external_pipeline instance_0
10:48:54 AM: == Change (#<Set: {:source}>): layouts/layout.erb
10:48:54 AM: == Change (#<Set: {:source}>): layouts/unauthorized.erb
10:48:54 AM: == Change (#<Set: {:source}>): employee-input.html.erb
10:48:54 AM: == Change (#<Set: {:source}>): course-session.html.erb
10:48:54 AM: == Change (#<Set: {:source}>): javascripts/training_schedule.js.erb
10:48:54 AM: == Change (#<Set: {:source}>): javascripts/session.js
10:48:54 AM: == Change (#<Set: {:source}>): javascripts/site.js.erb
10:48:54 AM: == Change (#<Set: {:source}>): javascripts/localization.js
10:48:54 AM: == Change (#<Set: {:source}>): javascripts/employee_input.js.erb
10:48:54 AM: == Change (#<Set: {:source}>): javascripts/course_session.js.erb
10:48:54 AM: == Change (#<Set: {:source}>): javascripts/util.js
10:48:54 AM: == Change (#<Set: {:source}>): javascripts/flash.js
10:48:54 AM: == Change (#<Set: {:source}>): javascripts/login.js.erb
10:48:54 AM: == Change (#<Set: {:source}>): javascripts/libs/underscore-min.js
10:48:54 AM: == Change (#<Set: {:source}>): javascripts/libs/dayjs_locales/es.js
10:48:54 AM: == Change (#<Set: {:source}>): javascripts/libs/dayjs_locales/en.js
10:48:54 AM: == Change (#<Set: {:source}>): javascripts/libs/dayjs.min.js
10:48:54 AM: == Change (#<Set: {:source}>): index.html.erb
10:48:54 AM: == Change (#<Set: {:source}>): stylesheets/site.css
10:48:54 AM: == Change (#<Set: {:source}>): images/favicon.ico
10:48:54 AM: == Change (#<Set: {:source}>): images/hazard_triangle.svg
10:48:54 AM: == Change (#<Set: {:source}>): images/exit_door.svg
10:48:54 AM: == Change (#<Set: {:source}>): images/.keep
10:48:54 AM: == Change (#<Set: {:source}>): images/background.png
10:48:54 AM: == Change (#<Set: {:source}>): images/login_header.jpg
10:48:54 AM: == Change (#<Set: {:source}>): images/man_at_whiteboard.svg
10:48:54 AM: == Change (#<Set: {:source}>): images/logo_black.png
10:48:54 AM: == Change (#<Set: {:source}>): images/company_banner_white.png
10:48:54 AM: == Change (#<Set: {:source}>): training-schedule.html.erb
10:48:54 AM: == Change (#<Set: {:source}>): login.html.erb
10:48:54 AM: == Rebuilding resource list
10:48:54 AM: == Requesting resource list rebuilding: touched_file
10:48:54 AM: == Requesting resource list rebuilding: registered_new_manipulator_front_matter
10:48:54 AM: == Requesting resource list rebuilding: registered_new_manipulator_sitemap_ondisk
10:48:54 AM: == Requesting resource list rebuilding: registered_new_manipulator_sitemap_import
10:48:54 AM: == Requesting resource list rebuilding: registered_new_manipulator_sitemap_endpoint
10:48:54 AM: == Requesting resource list rebuilding: registered_new_manipulator_sitemap_proxies
10:48:54 AM: == Requesting resource list rebuilding: registered_new_manipulator_sitemap_redirects
10:48:54 AM: == Requesting resource list rebuilding: registered_new_manipulator_sitemap_move_files
10:48:54 AM: == Requesting resource list rebuilding: registered_new_manipulator_sitemap_ignore
10:48:54 AM: == Requesting resource list rebuilding: registered_new_manipulator_routing
10:48:54 AM: == Requesting resource list rebuilding: registered_new_manipulator_routing
10:48:54 AM: == Requesting resource list rebuilding: registered_new_manipulator_collections
10:48:54 AM: == Rebuilding resource list
10:48:54 AM: == Running manipulator: sitemap_ondisk (0)
10:48:54 AM: == Running manipulator: sitemap_endpoint (0)
10:48:55 AM: Creating deploy upload records
10:48:54 AM: == Running manipulator: sitemap_proxies (0)
10:48:54 AM: == Running manipulator: sitemap_redirects (0)
10:48:54 AM: == Running manipulator: sitemap_ignore (0)
10:48:54 AM: == Running manipulator: sitemap_import (1)
10:48:54 AM: == Running manipulator: routing (10)
10:48:54 AM: == Running manipulator: front_matter (20)
10:48:54 AM: == Running manipulator: sitemap_move_files (101)
10:48:54 AM: == Running manipulator: collections (110)
10:48:54 AM: == Running manipulator: routing (130)
10:48:54 AM: == Prerendering CSS
10:48:54 AM: == Request: /stylesheets/site.css
10:48:54 AM: == Finishing Request: stylesheets/site.css (0.0s)
10:48:54 AM: create build/stylesheets/site.css
10:48:54 AM: == Building files
10:48:54 AM: create build/images/logo_black.png
10:48:54 AM: create build/images/background.png
10:48:54 AM: create build/images/company_banner_white.png
10:48:54 AM: create build/images/login_header.jpg
10:48:54 AM: create build/images/favicon.ico
10:48:55 AM: == Request: /images/hazard_triangle.svg
10:48:55 AM: == Finishing Request: images/hazard_triangle.svg (0.0s)
10:48:55 AM: create build/images/hazard_triangle.svg
10:48:55 AM: Starting post processing
10:48:55 AM: == Request: /images/man_at_whiteboard.svg
10:48:55 AM: == Finishing Request: images/man_at_whiteboard.svg (0.01s)
10:48:55 AM: create build/images/man_at_whiteboard.svg
10:48:55 AM: == Request: /javascripts/util.js
10:48:55 AM: == Finishing Request: javascripts/util.js (0.0s)
10:48:55 AM: create build/javascripts/util.js
10:48:55 AM: == Request: /javascripts/training_schedule.js
10:48:55 AM: Post processing - HTML
10:48:55 AM: == Finishing Request: javascripts/training_schedule.js (0.02s)
10:48:55 AM: create build/javascripts/training_schedule.js
10:48:55 AM: == Request: /javascripts/course_session.js
10:48:55 AM: == Finishing Request: javascripts/course_session.js (0.01s)
10:48:55 AM: create build/javascripts/course_session.js
10:48:55 AM: == Request: /javascripts/flash.js
10:48:55 AM: == Finishing Request: javascripts/flash.js (0.0s)
10:48:55 AM: create build/javascripts/flash.js
10:48:55 AM: == Request: /javascripts/login.js
10:48:55 AM: == Finishing Request: javascripts/login.js (0.01s)
10:48:55 AM: create build/javascripts/login.js
10:48:55 AM: == Request: /javascripts/libs/dayjs_locales/es.js
10:48:55 AM: == Finishing Request: javascripts/libs/dayjs_locales/es.js (0.01s)
10:48:55 AM: create build/javascripts/libs/dayjs_locales/es.js
10:48:55 AM: == Request: /javascripts/libs/underscore-min.js
10:48:55 AM: == Finishing Request: javascripts/libs/underscore-min.js (0.0s)
10:48:55 AM: create build/javascripts/libs/underscore-min.js
10:48:55 AM: == Request: /javascripts/libs/dayjs_locales/en.js
10:48:55 AM: == Finishing Request: javascripts/libs/dayjs_locales/en.js (0.0s)
10:48:55 AM: create build/javascripts/libs/dayjs_locales/en.js
10:48:55 AM: == Request: /javascripts/employee_input.js
10:48:55 AM: == Finishing Request: javascripts/employee_input.js (0.02s)
10:48:55 AM: create build/javascripts/employee_input.js
10:48:55 AM: == Request: /javascripts/libs/dayjs.min.js
10:48:55 AM: == Finishing Request: javascripts/libs/dayjs.min.js (0.0s)
10:48:55 AM: create build/javascripts/libs/dayjs.min.js
10:48:55 AM: == Request: /images/.keep
10:48:55 AM: == Finishing Request: images/.keep (0.0s)
10:48:55 AM: create build/images/.keep
10:48:55 AM: == Request: /course-session.html
10:48:55 AM: == Finishing Request: course-session.html (0.07s)
10:48:55 AM: create build/course-session.html
10:48:55 AM: == Request: /employee-input.html
10:48:55 AM: == Finishing Request: employee-input.html (0.06s)
10:48:55 AM: create build/employee-input.html
10:48:55 AM: == Request: /index.html
10:48:55 AM: == Finishing Request: index.html (0.05s)
10:48:55 AM: create build/index.html
10:48:55 AM: == Request: /javascripts/session.js
10:48:55 AM: == Finishing Request: javascripts/session.js (0.0s)
10:48:55 AM: create build/javascripts/session.js
10:48:55 AM: == Request: /training-schedule.html
10:48:55 AM: == Finishing Request: training-schedule.html (0.04s)
10:48:55 AM: create build/training-schedule.html
10:48:55 AM: == Request: /javascripts/localization.js
10:48:55 AM: == Finishing Request: javascripts/localization.js (0.0s)
10:48:55 AM: create build/javascripts/localization.js
10:48:55 AM: == Request: /login.html
10:48:55 AM: == Finishing Request: login.html (0.03s)
10:48:55 AM: create build/login.html
10:48:55 AM: == Request: /images/exit_door.svg
10:48:55 AM: == Finishing Request: images/exit_door.svg (0.0s)
10:48:55 AM: create build/images/exit_door.svg
10:48:55 AM: == Request: /javascripts/site.js
10:48:55 AM: == Finishing Request: javascripts/site.js (0.0s)
10:48:55 AM: create build/javascripts/site.js
→ 10:48:55 AM: remove build/stylesheets/styles.css
10:48:55 AM: Project built successfully.
10:48:55 AM: ​
10:48:55 AM: (build.command completed in 10.4s)
10:48:55 AM: ​
10:48:55 AM: ────────────────────────────────────────────────────────────────
10:48:55 AM: 2. Deploy site
10:48:55 AM: ────────────────────────────────────────────────────────────────
10:48:55 AM: ​
10:48:55 AM: Starting to deploy site from ‘build’
10:48:55 AM: Creating deploy tree
10:48:55 AM: 0 new files to upload
10:48:55 AM: 0 new functions to upload
10:48:55 AM: Site deploy was successfully initiated
10:48:55 AM: ​
10:48:55 AM: (Deploy site completed in 117ms)
10:48:55 AM: ​
10:48:55 AM: ────────────────────────────────────────────────────────────────
10:48:55 AM: Netlify Build Complete
10:48:55 AM: ────────────────────────────────────────────────────────────────
10:48:55 AM: ​
10:48:55 AM: (Netlify Build completed in 10.7s)
10:48:55 AM: Caching artifacts
10:48:55 AM: Started saving ruby gems
10:48:55 AM: Finished saving ruby gems
10:48:55 AM: Started saving node modules
10:48:55 AM: Finished saving node modules
10:48:55 AM: Started saving build plugins
10:48:55 AM: Finished saving build plugins
10:48:55 AM: Started saving pip cache
10:48:55 AM: Finished saving pip cache
10:48:55 AM: Started saving emacs cask dependencies
10:48:55 AM: Finished saving emacs cask dependencies
10:48:55 AM: Started saving maven dependencies
10:48:55 AM: Finished saving maven dependencies
10:48:55 AM: Started saving boot dependencies
10:48:55 AM: Finished saving boot dependencies
10:48:55 AM: Started saving rust rustup cache
10:48:55 AM: Finished saving rust rustup cache
10:48:55 AM: Started saving go dependencies
10:48:55 AM: Post processing - header rules
10:48:56 AM: Post processing - redirect rules
10:48:56 AM: Post processing done
10:48:56 AM: Site is live :sparkles:
10:48:57 AM: Finished saving go dependencies
10:48:58 AM: Build script success
10:50:00 AM: Finished processing build request in 1m49.794370314s

Our best advice on these questions is to run locally:

Then, after the build, you are in the build environment and can e.g. read npm debug files and see what happened and retry build steps that didn’t work as you like.

Nothing about Netlify’s service is configured to remove your files if your source code is not configured to do so, so this is something within your config rather than something our service is “doing” automatically…