Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v4] 4.0.8 Vite plugin breaks if there are virtual imports like unfonts.css #16732

Open
octoper opened this issue Feb 22, 2025 · 0 comments
Open

Comments

@octoper
Copy link

octoper commented Feb 22, 2025

What version of Tailwind CSS are you using?

For example: v4.0.8

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

For example: Vite v6.1.1

What version of Node.js are you using?

For example: v20.13.1

What browser are you using?

For example: Chrome

What operating system are you using?

For example: macOS

Reproduction URL

https://github.com/octoper/vitejs-tailwind408-repro

Describe your issue

When upgraded to @tailwindcss/vite to 4.0.8 I started seeing the error below, this seem to occur when I'm importing a virtual module unfonts.css coming from the https://github.com/cssninjaStudio/unplugin-fonts Vite plugin. Downgrading to 4.0.7 fixes the issue

node:internal/fs/promises:1028
  path = getValidatedPath(path);
         ^

TypeError [ERR_INVALID_ARG_VALUE]: The argument 'path' must be a string, Uint8Array, or URL without null bytes. Received '/Users/octoper/projects/vitejs-tailwind408-repro/\x00unfonts.css'
    at Object.stat (node:internal/fs/promises:1028:10)
    at C.addBuildDependency (file:///Users/octoper/projects/vitejs-tailwind408-repro/node_modules/@tailwindcss/vite/dist/index.mjs:1:5234)
    at C.generate (file:///Users/octoper/projects/vitejs-tailwind408-repro/node_modules/@tailwindcss/vite/dist/index.mjs:1:3810)
    at TransformPluginContext.transform (file:///Users/octoper/projects/vitejs-tailwind408-repro/node_modules/@tailwindcss/vite/dist/index.mjs:1:1967)
    at EnvironmentPluginContainer.transform (file:///Users/octoper/projects/vitejs-tailwind408-repro/node_modules/vite/dist/node/chunks/dep-Cg8OuIew.js:48466:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async loadAndTransform (file:///Users/octoper/projects/vitejs-tailwind408-repro/node_modules/vite/dist/node/chunks/dep-Cg8OuIew.js:42166:27) {
  code: 'ERR_INVALID_ARG_VALUE'
}
@octoper octoper changed the title [v4] 4.0.8 Vite plugin version breaks if there are virtual imports like unfonts.css [v4] 4.0.8 Vite plugin breaks if there are virtual imports like unfonts.css Feb 22, 2025
sodenn added a commit to sodenn/2do-txt that referenced this issue Feb 22, 2025
sodenn added a commit to sodenn/2do-txt that referenced this issue Feb 22, 2025
* chore(deps): update devdependencies (non-major)

* downgrade @tailwindcss/vite to 4.0.7
See tailwindlabs/tailwindcss#16732

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: sodenn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant