Skip to content

installing tailwindcss v4.1.3 crashing the react vite app with Error: Cannot find module '../lightningcss.win32-x64-msvc.node' #17587

@ehsanrezaeee

Description

@ehsanrezaeee

What version of Tailwind CSS are you using?

v4.1.3

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

React 19.1.0, Vite 6.2.0

What version of Node.js are you using?

v22.14.0

What browser are you using?

Chrome

What operating system are you using?

Windows 10 Education

Reproduction URL

https://github.com/ehsanrezaeee/lightningcss-bug-tailwindcss.git

Describe your issue

installing fresh react vite application with "pnpm create vite" and then installing tailwindcss v4.1 with vite configuration. then starting the development server and facing this error:

pnpm dev

react@0.0.0 dev C:\Users\Free\WebstormProjects\react
vite

failed to load config from C:\Users\Free\WebstormProjects\react\vite.config.ts
error when starting dev server:
Error: Cannot find module '../lightningcss.win32-x64-msvc.node'
Require stack:

  • C:\Users\Free\WebstormProjects\react\node_modules.pnpm\lightningcss@1.29.2\node_modules\lightningcss\node\index.js
    at Function._resolveFilename (node:internal/modules/cjs/loader:1225:15)
    at Function._load (node:internal/modules/cjs/loader:1055:27)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
    at Module.require (node:internal/modules/cjs/loader:1311:12)
    at require (node:internal/modules/helpers:136:16)
    at Object. (C:\Users\Free\WebstormProjects\react\node_modules.pnpm\lightningcss@1.29.2\node_modules\lightningcss\node\index.js:22:22)
    at Module._compile (node:internal/modules/cjs/loader:1554:14)
    at Object..js (node:internal/modules/cjs/loader:1706:10)
    at Module.load (node:internal/modules/cjs/loader:1289:32)
     ELIFECYCLE  Command failed with exit code 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