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

[Bug]: Crash with "The argument 'path' must be a [...] without null bytes." with @tailwindcss/vite 4.0.8 #30626

Open
avinashbot opened this issue Feb 21, 2025 · 3 comments

Comments

@avinashbot
Copy link

avinashbot commented Feb 21, 2025

Describe the bug

When starting the storybook dev server (in my react-router v7 app, but that's unrelated) along with @tailwindcss/vite@4.0.8, the server crashes with the following error:

/Users/avinash/app/node_modules/storybook/bin/index.cjs:23
  throw error;
  ^

TypeError [ERR_INVALID_ARG_VALUE]: The argument 'path' must be a string, Uint8Array, or URL without null bytes. Received '/Users/avinash/app/\x00/iframe.html'
    at Object.stat (node:internal/fs/promises:1037:18)
    at C.addBuildDependency (file:///Users/avinash/app/node_modules/@tailwindcss/vite/dist/index.mjs:1:5234)
    at C.generate (file:///Users/avinash/app/node_modules/@tailwindcss/vite/dist/index.mjs:1:3810)
    at TransformPluginContext.transform (file:///Users/avinash/app/node_modules/@tailwindcss/vite/dist/index.mjs:1:1967)
    at EnvironmentPluginContainer.transform (file:///Users/avinash/app/node_modules/vite/dist/node/chunks/dep-Cg8OuIew.js:48466:19)
    at async file:///Users/avinash/app/node_modules/vite/dist/node/chunks/dep-Cg8OuIew.js:43944:22
    at async Promise.all (index 0)
    at async devHtmlHook (file:///Users/avinash/app/node_modules/vite/dist/node/chunks/dep-Cg8OuIew.js:43936:3)
    at async applyHtmlTransforms (file:///Users/avinash/app/node_modules/vite/dist/node/chunks/dep-Cg8OuIew.js:43352:17)
    at async Array.<anonymous> (/Users/avinash/app/node_modules/@storybook/builder-vite/dist/index.js:73:5860) {
  code: 'ERR_INVALID_ARG_VALUE'
}

Node.js v22.13.0

Notably, this works fine with @tailwindcss/vite@4.0.7, so something broke in that patch. Not sure whether it's vite's "fault" or storybook's, but I'm opening it here first because everything else builds just fine for me - it's just storybook that crashes.

Reproduction link

https://codesandbox.io/p/devbox/crln9h

Reproduction steps

  1. Go to link above
  2. Run the storybook task to start the dev server
  3. Storybook crashes

System

Storybook Environment Info:

  System:
    OS: macOS 15.3.1
    CPU: (8) arm64 Apple M1
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.13.0 - ~/.n/bin/node
    Yarn: 3.4.1 - ~/.n/bin/yarn
    npm: 11.0.0 - ~/.n/bin/npm <----- active
    pnpm: 8.4.0 - ~/.n/bin/pnpm
  Browsers:
    Chrome: 133.0.6943.127
    Safari: 18.3
  npmPackages:
    @storybook/addon-essentials: ^8.5.8 => 8.5.8 
    @storybook/addon-interactions: ^8.5.8 => 8.5.8 
    @storybook/blocks: ^8.5.8 => 8.5.8 
    @storybook/react: ^8.5.8 => 8.5.8 
    @storybook/react-vite: ^8.5.8 => 8.5.8 
    @storybook/test: ^8.5.8 => 8.5.8 
    eslint-plugin-storybook: ^0.11.3 => 0.11.3 
    storybook: ^8.5.8 => 8.5.8

Additional context

Possibly related to #28635, but this still seems different. I don't have to enable anything special or even use tailwind classes. I just have to add the tailwind vite plugin (see the vite config in the repro) and that's all it takes to take down the preview.

@burtonrhodes
Copy link

I am seeing this as well

@pheuter
Copy link

pheuter commented Feb 23, 2025

You probably meant 4.0.8 instead of 3.0.8, in which case i'm also seeing this issue.

@avinashbot avinashbot changed the title [Bug]: Crash with "The argument 'path' must be a [...] without null bytes." with @tailwindcss/vite 3.0.8 [Bug]: Crash with "The argument 'path' must be a [...] without null bytes." with @tailwindcss/vite 4.0.8 Feb 23, 2025
@avinashbot
Copy link
Author

Whoops, you're right! Amended the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants