remix-run / blues-stack

The Remix Stack for deploying to Fly with PostgreSQL, authentication, testing, linting, formatting, etc.
https://remix.run/stacks
MIT License
972 stars 236 forks source link

Build failed while running npm run build on blues stack #229

Open crazydreamproject opened 10 months ago

crazydreamproject commented 10 months ago

Reproduction

Do following commands (on Node.js command prompt)

$ npx create-remix@latest --template remix-run/blues-stack $ npm run docker (wait a while until you see LOG: database system is ready to accept connections in docker logs) $ npm run setup $ npm run build

System Info

On Windows10, with docker desktop 4.25.1, node v20.11.0, npm 10.3.0

Used Package Manager

npm

Expected Behavior

$ npm run build to complete successfully

Actual Behavior

npm run build

build run-s build:*

build:remix remix build

info building... (NODE_ENV=production) The following error is a bug in Remix; please open an issue! https://github.com/remix-run/remix/issues/new The following error is a bug in Remix; please open an issue! https://github.com/remix-run/remix/issues/new X [ERROR] Build failed with 1 error: node_modules/@remix-run/dev/dist/compiler/plugins/cssImports.js:174:30: ERROR: [plugin: css-file] entry file not found [plugin css-bundle-plugin]

app/root.tsx:1:30:
  1 │ import { cssBundleHref } from "@remix-run/css-bundle";
    ╵                               ~~~~~~~~~~~~~~~~~~~~~~~

This error came from the "onLoad" callback registered here:

node_modules/@remix-run/dev/dist/compiler/plugins/cssBundlePlugin.js:35:12:
  35 │       build.onLoad({
     ╵             ~~~~~~

at setup (C:\Users\CDP\GitHub\remix-blues-test\node_modules\@remix-run\dev\dist\compiler\plugins\cssBundlePlugin.js:35:13)
at handlePlugins (C:\Users\CDP\GitHub\remix-blues-test\node_modules\@remix-run\dev\node_modules\esbuild\lib\main.js:1279:21)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

X [ERROR] entry file not found [plugin css-file]

node_modules/@remix-run/dev/dist/compiler/plugins/cssImports.js:174:30:
  174 │           invariant["default"](entryFile, "entry file not found");
      ╵                               ^

at Object.invariant [as default] (C:\Users\CDP\GitHub\remix-blues-test\node_modules\@remix-run\dev\dist\invariant.js:18:11)
at C:\Users\CDP\GitHub\remix-blues-test\node_modules\@remix-run\dev\dist\compiler\plugins\cssImports.js:174:31
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

This error came from the "onLoad" callback registered here:

node_modules/@remix-run/dev/dist/compiler/plugins/cssImports.js:77:12:
  77 │       build.onLoad({
     ╵             ~~~~~~

at setup (C:\Users\CDP\GitHub\remix-blues-test\node_modules\@remix-run\dev\dist\compiler\plugins\cssImports.js:77:13)
at handlePlugins (C:\Users\CDP\GitHub\remix-blues-test\node_modules\@remix-run\dev\node_modules\esbuild\lib\main.js:1279:21)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

The plugin "css-file" was triggered by this import

app/root.tsx:14:23:
  14 │ import stylesheet from "~/tailwind.css";
     ╵                        ~~~~~~~~~~~~~~~~

ERROR: "build:remix" exited with 1.

crazydreamproject commented 10 months ago

Some more info: I'm using remix v2.5.0, changing to 2.5.1 has same issue. CUI I'm using is Nodejs command prompt (installed by node.js installer) When I change CUI to gitbash, npm run build exited successfully.

Hope this helps,

brophdawg11 commented 10 months ago

This must have something to do with the node command prompt you're using since it works in gitbash (and I also confirmed it all runs fine on my OSX machine). I'm going to transfer this to the blues-stack repo as an issue specific to that setup when using the node command prompt.