Skip to content

[Bug]: Error: No "exports" main defined in node_modules/@tailwindcss/vite/package.json #36451

Closed
@moshie

Description

@moshie

Version

1.53.1

Steps to reproduce

  1. Clone down https://github.com/moshie/tailwind-vite-playwright-bug-reproduction.git
  2. Run pnpm i
  3. Run pnpm test-ct
  4. Observe Error

Expected behavior

When I run pnpm test-ct I expect the tests to run successfully

Actual behavior

When running pnpm test-ct vite is using a CJS build which is now deprecated and causing an error with the latest version of tailwindcss/vite.

The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
Error: No "exports" main defined in /home/.../node_modules/@tailwindcss/vite/package.json

Additional context

I added "default" to the tailwind package json this does fix it although it doesn't feel like the right solution:

Tailwind PR / issue: tailwindlabs/tailwindcss#18287

Environment

System:
    OS: macOS 15.5
    CPU: (10) arm64 Apple M1 Max
    Memory: 2.93 GB / 32.00 GB
  Binaries:
    Node: 22.17.0 - /opt/homebrew/opt/node@22/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 10.9.2 - /opt/homebrew/opt/node@22/bin/npm
    pnpm: 10.12.3 - ~/Library/pnpm/pnpm
  Languages:
    Bash: 3.2.57 - /bin/bash
  npmPackages:
    @playwright/experimental-ct-react: ^1.53.1 => 1.53.1
    @playwright/test: ^1.53.1 => 1.53.1

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