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

Vitest hangs with PostCSS #4201

Closed
robertu7 opened this issue Sep 30, 2023 · 3 comments
Closed

Vitest hangs with PostCSS #4201

robertu7 opened this issue Sep 30, 2023 · 3 comments
Labels
p2-edge-case Bug, but has workaround or limited in scope (priority) upstream

Comments

@robertu7
Copy link

robertu7 commented Sep 30, 2023

Describe the bug

Vitest hangs if the PostCSS config is in package.json.

Also, it throws errors if use postcss.config.js w/o the require shape (which is not supported by Next.js, so I cannot make Vitest and Next.js work together):

⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯
Failed to load PostCSS config: Failed to load PostCSS config (searchPath: /home/runner/work/matters-web/matters-web): [TypeError] Invalid PostCSS Plugin found at: plugins[0]

(@/home/runner/work/matters-web/matters-web/postcss.config.js)
TypeError: Invalid PostCSS Plugin found at: plugins[0]

Reproduction

  1. Pull the repo (commit: 5951659928d);
  2. npm install;
  3. npm run test:unit;
  4. vitest is hanging;

System Info

System:
    OS: macOS 14.0
    CPU: (8) arm64 Apple M1 Pro
    Memory: 267.38 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.17 - /opt/homebrew/bin/yarn
    npm: 8.7.0 - /opt/homebrew/bin/npm
    pnpm: 6.11.0 - /usr/local/bin/pnpm
  Browsers:
    Brave Browser: 115.1.56.20
    Chrome: 116.0.5845.96
    Edge: 114.0.1823.51
    Safari: 17.0
  npmPackages:
    @vitejs/plugin-react: ^4.1.0 => 4.1.0 
    vitest: ^0.34.6 => 0.34.6 


### Used Package Manager

npm

### Validations

- [X] Follow our [Code of Conduct](https://github.com/vitest-dev/vitest/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guidelines](https://github.com/vitest-dev/vitest/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://vitest.dev/guide/).
- [X] Check that there isn't [already an issue](https://github.com/vitest-dev/vitest/issues) that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/vitest-dev/vitest/discussions) or join our [Discord Chat Server](https://chat.vitest.dev).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
@robertu7
Copy link
Author

Update: Found a workaround, can be fixed by changing the postcss.config.js to postcss.config.json: https://github.com/thematters/matters-web/blob/646564c151e8bf731c7a0f22d9db90f403265328/postcss.config.json

@sheremet-va sheremet-va added bug p2-edge-case Bug, but has workaround or limited in scope (priority) and removed pending triage labels Oct 2, 2023
@Manish3323
Copy link

@sheremet-va sheremet-va added upstream and removed bug labels Feb 16, 2024
@sheremet-va
Copy link
Member

If this is still an issue, I would recommend opening an issue in the Vite repository instead since we don't control this in any way.

@sheremet-va sheremet-va closed this as not planned Won't fix, can't repro, duplicate, stale Feb 16, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p2-edge-case Bug, but has workaround or limited in scope (priority) upstream
Projects
None yet
Development

No branches or pull requests

3 participants