Skip to content

v4 CLI: --watch --map appends "undefined" to output; --map <file> triggers TypeError [ERR_INVALID_ARG_TYPE] #19362

@RV7PR

Description

@RV7PR

What version of Tailwind CSS are you using?
v4.1.17

What build tool (or framework if it abstracts the build tool) are you using?
Tailwind CLI (via npx @tailwindcss/cli or bunx)

What version of Node.js are you using?
Node.js v25.2.1 Bun v1.3.3

What browser are you using?
N/A (CLI issue)

What operating system are you using?
macOS (MacBook Pro 16-inch 2023)

Minimal repro:

Empty input.css and add simple class while watching.

Bun:
bunx @tailwindcss/cli -i ./src/input.css -o ./dist/output.css --watch --map ./dist/output.css.map
bunx @tailwindcss/cli -i ./src/input.css -o ./dist/output.css --watch --map

Node:
bunx @tailwindcss/cli -i ./src/input.css -o ./dist/output.css --watch --map ./dist/output.css.map
bunx @tailwindcss/cli -i ./src/input.css -o ./dist/output.css --watch --map

Describe your issue
In watch mode with --map:

  • Inline (--map): Corrupts output.css end with "undefined" on changes.
  • Separate file (--map ./output.css.map): Crashes with TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined.

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