Skip to content

[Start] CSS files in node-server build don't work with Tailwind 4.0 #2899

Closed
@glecetre

Description

@glecetre

Which project does this relate to?

Start

Describe the bug

When using TailwindCSS v4.0 beta, the node-server build has problems with stylesheets.
Here's a repro repo: https://github.com/glecetre/tanstack-start-tailwind-beta.

It works without issue in dev (pnpm dev) but doesn't on the built app (pnpm build && node .output/server/index.mjs.)

From what I can gather (I don't fully understand the build process), the CSS file generates at least two different assets: .output/public/assets/app-{hash}.css and .output/public/_build/assets/app-{hash}.css. I think it's for server-side and client-side import. The problem is that these assets don't have the same hash, but the generated HTML doesn't seem to make a difference.

Example of generated assets:

.output/
  public/
    _build/
      assets/
        app-C5S9l2go.css
    assets/
      app-DMI6-ub3.css

Here's the HTML's link tag for this resource: <link rel="stylesheet" href="/_build/assets/app-DMI6-ub3.css">.

I understand that Tailwind 4.0 being in beta, this issue may not be relevant until the release candidate in which case it could be closed without further investigation. Thanks!

Your Example Website or App

https://github.com/glecetre/tanstack-start-tailwind-beta

Steps to Reproduce the Bug or Issue

  1. Clone the repo
  2. pnpm i
  3. pnpm dev --> all good
  4. pnpm build && node .output/server/index.mjs --> not all good

Expected behavior

As a visitor I expect to see the page with styling.

Screenshots or Videos

No response

Platform

  • OS: Fedora 41
  • Browser: Firefox
  • Version: 132.0.1

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionThis issue is about a user needing insightstartEverything about TanStack Start

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions