Issue with Deploy

Hey guys, this morning I tried to deploy an application using Remix, Vite, and Tailwindcss.
My exports look like this for postcss’s config:

module.exports = {
  plugins: {
    tailwindcss: {},
    autoprefixer: {},
  },
};

And my vite config looks like this:

import { vitePlugin as remix } from "@remix-run/dev";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";

export default defineConfig({
  plugins: [
    remix({
      future: {
        v3_fetcherPersist: true,
        v3_relativeSplatPath: true,
        v3_throwAbortReason: true,
      },
    }),
    tsconfigPaths(),
  ],
  css: {
    postcss: "./postcss.config.cjs",
  },
});

My build command looks like this:

    buildCommand: pnpm install --production=false && pnpm run build && pnpm prune --production

And I keep getting this error:

[vite:css-post] css content for "" was not found
    at Object.renderChunk (file:///opt/render/project/src/node_modules/.pnpm/vite@5.4.8/node_modules/vite/dist/node/chunks/dep-CDnG8rE7.js:36359:19)
    at file:///opt/render/project/src/node_modules/.pnpm/rollup@4.22.4/node_modules/rollup/dist/es/shared/node-entry.js:19936:40
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
  code: 'PLUGIN_ERROR',
  plugin: 'vite:css-post',
  hook: 'renderChunk'
}

The kicker is that my older commits don’t build either, I’ve selected previously successful builds’ commit hashes and nothing seems to work. I didn’t touch any settings whatsoever either.

Same here. Also using remix/tailwind/vite, but not sure that’s relevant. Something’s broken on Render’s end…

x Build failed in 6.80s
[vite:css-post] css content for "" was not found
    at Object.renderChunk (file:///opt/render/project/src/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:36388:19)
    at file:///opt/render/project/src/node_modules/rollup/dist/es/shared/node-entry.js:20730:40
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
  code: 'PLUGIN_ERROR',
  plugin: 'vite:css-post',
  hook: 'renderChunk'
}
(node:129) ExperimentalWarning: CommonJS module /opt/render/project/nodes/node-23.2.0/lib/node_modules/npm/node_modules/debug/src/node.js is loading ES Module /opt/render/project/nodes/node-23.2.0/lib/node_modules/npm/node_modules/supports-color/index.js using require().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

I wonder what happened, deploys were working before the weekend.

Hey folks, Vite just updated yesterday ( Releases · vitejs/vite · GitHub ).

Coincidentally, the only change is an update of their “postcss-modules” dependency ( Vite 5.4.11 has empty changelog · Issue #18639 · vitejs/vite · GitHub ), which I note is in the error you’re reporting here.

I recommend downgrading to Vite 5.4.10 to see if that resolves the issue. If it does, then the problem is Vite’s dependency change in 5.4.11.

This is unlikely to be a Render-specific issue.

I also have the same issue, but it is not resolving with downgraded vite version. Version I am using 5.4.8

Fixed it by specifying the node version exact as my dev enivornment i.e. 20.17.0. I gues vite did not work with the node version 23 which was getting installed during deploy.

It is indeed actually related to the node version.

My latest successful deploy was using 23.1.0, and when the deploy started using 23.2.0 (latest) it stopped working.

I specified the same now as I use on my local - 22.11.0 - and no problems now. Good to know that I should set versions explicitly, or at least with an upper range, as Render actually suggests in the docs.

EDIT: Just checked that indeed 23.1.0 still works, so 23.2.0 breaks it for some reason…

same thing here

working well with node 22.11.0 and npm 9.0 but node >=23.0.0 and npm 10.0 not working