Skip to content

When I run my app in productions tailwind doenst build assets #524

Closed as not planned
@rodrigoazv

Description

@rodrigoazv

#When I run my app in production, Tailwind doesn't build the assets.

Locally, when I run rails assets:precompile, I receive this output:


                                                                                                                                                         +   09:46:14
❯ SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile --trace
** Invoke assets:precompile (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke tailwindcss:build (first_time)
** Invoke environment
** Execute tailwindcss:build
≈ tailwindcss v4.0.17

Done in 55ms
** Execute assets:precompile
Warning: You are precompiling assets in development. Rails will not serve any changed assets until you delete public/assets/.manifest.json

My app creates the Tailwind build files correctly.

But when my Dockerfile runs in production mode, the Tailwind precompiled assets don't build with the rest of the app, and my output doesn't include any Tailwind files.

Image

When I run rails server locally, works well, but in production doesnt work, don't apply any style.

I'm using rails 8, and v4 of all tailwind dependencies.

Has some config missing for production mode? I just create rails new --css=tailwind for test

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions