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

Importing @tailwindcss/utilities in CSS file causes ENOBUFS error #260

Open
davidhao3300 opened this issue Sep 7, 2022 · 3 comments
Open
Labels
bug Something isn't working

Comments

@davidhao3300
Copy link

Describe the bug

Hello, me again.

The CSS transformer errors out with ENOBUFS with the following CSS file contents:

@import 'tailwindcss/utilities';

We use tailwindcss 1.9.6 if that helps, my suspicion is that it's just a large CSS file or something.

The full error:

  ● Test suite failed to run                                                                                                                         [110/1363]

    spawnSync node ENOBUFS

      at processPostCss (node_modules/jest-preview/transforms/css.js:254:34)
      at processCss (node_modules/jest-preview/transforms/css.js:114:16)
      at Object.process$1 [as process] (node_modules/jest-preview/transforms/css.js:371:12)
      at ScriptTransformer.transformSource (node_modules/@jest/transform/build/ScriptTransformer.js:464:35)
      at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:569:40)
      at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:607:25)

Corresponds to https://github.com/nvh95/jest-preview/blob/main/src/transform.ts#L356

I changed the erroring line to
const result = child_process.spawnSync('node', [tempFileName], {maxBuffer: 10 * 1024 * 1024});, which works. The maxBuffer default is 1MB or something, and not sure what you want the actual value to be.

Expected behavior

No error to occur

@davidhao3300 davidhao3300 added the bug Something isn't working label Sep 7, 2022
@nvh95
Copy link
Owner

nvh95 commented Sep 8, 2022

Hi @davidhao3300

Thanks for reporting this. Can you help to prepare a reproduction? It's hard for me to fix this without properly reproducing this. Thanks.

@davidhao3300
Copy link
Author

I'm not a frontend expert, so this is my guess to a repro:

  • Have [email protected] installed
  • Have a single css file with @import 'tailwindcss/utilities'; as the contents
  • include the CSS file and have it transformed by the jest-preview CSS transformer

@ilankleingong
Copy link

hi, I am now getting this issue on my less local files, which are big
any chance to get a new version with the buffer fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants