Issues getting Django and Django Tailwind CSS to build
yayadrian
HOBBYOP

2 years ago

I have a Django project that is using Django Tailwind.

In my railway.json I have this line:

"startCommand": "python3 manage.py tailwind build && python3 manage.py migrate && python3 manage.py collectstatic --noinput && gunicorn poll.wsgi"

I have Python and NodeJS set as Language providers.

tailwind build is the part that causes the below error.

ERROR FROM LOG:

container event container died

npm WARN config production Use --omit=dev instead.

theme@3.8.0 build:tailwind

cross-env NODE_ENV=production tailwindcss --postcss -i ./src/styles.css -o ../static/css/dist/styles.css --minify

node:events:496

throw er; // Unhandled 'error' event

^

Error: spawn tailwindcss ENOENT

at ChildProcess._handle.onexit (node:internal/child_process:286:19)

at onErrorNT (node:internal/child_process:484:16)

at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Emitted 'error' event on ChildProcess instance at:

at ChildProcess._handle.onexit (node:internal/child_process:292:12)

at onErrorNT (node:internal/child_process:484:16)

at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {

errno: -2,

code: 'ENOENT',

syscall: 'spawn tailwindcss',

path: 'tailwindcss',

spawnargs: [

'--postcss',

'-i',

'./src/styles.css',

'-o',

'../static/css/dist/styles.css',

'--minify'

]

}

View Deploy details

ⓘ Deployment information is only viewable by project members and Railway employees.

3 Replies

2 years ago

Hello, what command do you need to run to generate the css?


yayadrian
HOBBYOP

2 years ago

python3 manage.py tailwind build

is used to build the CSS with django-tailwinds.

Running locally is fine so not sure what I'm missing to make it crash


2 years ago

Could you simply build the css locally and upload it to your repo?


Welcome!

Sign in to your Railway account to join the conversation.

Loading...