Skip to content

@source directive not working with pnpm #16038

@adityaa72

Description

@adityaa72

What version of Tailwind CSS are you using?

v4.0.1

What build tool (or framework if it abstracts the build tool) are you using?

Next.js v15.1.6

What version of Node.js are you using?

v20.0.0

What browser are you using?

Firefox

What operating system are you using?

macOS

Reproduction URL

Tailwind 4 with pnpm
Tailwind 4 with yarn

Describe your issue

@source directive not working for node_modules packages with pnpm and nextjs. The same code is working with nextjs and yarn, and nextjs and npm, also same package works with pnpm with vite with @tailwindcss/vite

@import "tailwindcss";
@import "@jamsr-ui/theme/styles.css";

/* This is not working */
@source "../node_modules/@jamsr-ui";

/* These are working */
/* @source "../node_modules/@jamsr-ui/text"; */
/* @source "../node_modules/@jamsr-ui/button"; */
/* @source "../node_modules/@jamsr-ui/utils"; */
/* @source "../node_modules"; */

Here @source "../node_modules/@jamsr-ui"; is not working but nested @source are working as like @source "../node_modules/@jamsr-ui/text";.
Even @source "../node_modules" is working

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions