Skip to content

input.css breaks ManifestStaticFilesStorage/WhiteNoise collectstatic #159

Description

@duf59

I'm using whitenoise and ran into the following error when bumping django-allauth-ui:

whitenoise.storage.MissingFileError: The file 'allauth_ui/tailwindcss' could not be found ...

The root cause is the switch from Tailwind v3 to Tailwind v4. The source file allauth_ui/input.css changed from:

@tailwind base;
@tailwind components;
@tailwind utilities;

to:

@import "tailwindcss";
@plugin "daisyui" { themes: all; }

During collectstatic, WhiteNoise's CompressedManifestStaticFilesStorage post-processes every CSS file and tries to resolve @import targets to real static files. It resolved tailwindcss to allauth_ui/tailwindcss, which doesn't exist.

The actually-served stylesheet is the compiled output.css, input.css is just a build source that isn't referenced by any template.

For now I fixed in my project by subclassing CompressedManifestStaticFilesStorage and ignore allauth_ui/input.css.

A proper fix here would be to move the source out of allauth_ui/static/ into a non-collected directory, for example static_src/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions