Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@9romise
Copy link
Member

@9romise 9romise commented Nov 4, 2025

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.
⚠️ Slowing down new functions

Warning: Slowing down new functions

As the VueUse audience continues to grow, we have been inundated with an overwhelming number of feature requests and pull requests. As a result, maintaining the project has become increasingly challenging and has stretched our capacity to its limits. As such, in the near future, we may need to slow down our acceptance of new features and prioritize the stability and quality of existing functions. Please note that new features for VueUse may not be accepted at this time. If you have any new ideas, we suggest that you first incorporate them into your own codebase, iterate on them to suit your needs, and assess their generalizability. If you strongly believe that your ideas are beneficial to the community, you may submit a pull request along with your use cases, and we would be happy to review and discuss them. Thank you for your understanding.


Description

CI is failing in the useFetch tests. It seems related to vitest and has been fixed in vitest v4, see: vitest-dev/vitest#8374

Additional context

#5138 (comment)

@9romise
Copy link
Member Author

9romise commented Nov 4, 2025

Typecheck failures in CI should be fixed by #5138.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 4, 2025

Open in StackBlitz

@vueuse/components

npm i https://pkg.pr.new/@vueuse/components@5141

@vueuse/core

npm i https://pkg.pr.new/@vueuse/core@5141

@vueuse/electron

npm i https://pkg.pr.new/@vueuse/electron@5141

@vueuse/firebase

npm i https://pkg.pr.new/@vueuse/firebase@5141

@vueuse/integrations

npm i https://pkg.pr.new/@vueuse/integrations@5141

@vueuse/math

npm i https://pkg.pr.new/@vueuse/math@5141

@vueuse/metadata

npm i https://pkg.pr.new/@vueuse/metadata@5141

@vueuse/nuxt

npm i https://pkg.pr.new/@vueuse/nuxt@5141

@vueuse/router

npm i https://pkg.pr.new/@vueuse/router@5141

@vueuse/rxjs

npm i https://pkg.pr.new/@vueuse/rxjs@5141

@vueuse/shared

npm i https://pkg.pr.new/@vueuse/shared@5141

commit: 67f4474

@userquin
Copy link
Contributor

userquin commented Nov 4, 2025

can you fix lockfile? run pnpm dedupe, maybe we should add rolldown-vite to resolutions at root package.json (replace vitepress>vite entry with just vite in the key)

@9romise
Copy link
Member Author

9romise commented Nov 4, 2025

can you fix lockfile? run pnpm dedupe, maybe we should add rolldown-vite to resolutions at root package.json (replace vitepress>vite entry with just vite in the key)

I think we can merge #5138 first.

@userquin
Copy link
Contributor

userquin commented Nov 4, 2025

this looks better, run test script from root and update the tests (press u once tests finish running if vitest running in watch mode)

@9romise
Copy link
Member Author

9romise commented Nov 4, 2025

The test errors aren't related to snapshots. They seem to be caused by upstream changes. I'm also looking into solutions.
Thanks a lot for your help and tracking!

@userquin
Copy link
Contributor

userquin commented Nov 5, 2025

Looks like we've a regression in jsdom, try pinning jsdom to 20.0.3: vitest-dev/vitest#8017 (comment)

@9romise
Copy link
Member Author

9romise commented Nov 5, 2025

Looks like we've a regression in jsdom, try pinning jsdom to 20.0.3: vitest-dev/vitest#8017 (comment)

This issue doesn't seem directly related to our problem — it reports incorrect return values, while we're encountering getComputedStyle being undefined.
I suspect it might be related to cb8ec13 (#5141). Let's give it a try. CI looks like it's all passed now.

@9romise 9romise marked this pull request as ready for review November 5, 2025 11:36
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. dependencies Pull requests that update a dependency file labels Nov 5, 2025
@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.63%. Comparing base (0176d64) to head (0c61838).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5141      +/-   ##
==========================================
- Coverage   67.71%   63.63%   -4.09%     
==========================================
  Files         367      345      -22     
  Lines       14721     7853    -6868     
  Branches     2456     2426      -30     
==========================================
- Hits         9968     4997    -4971     
+ Misses       4742     2312    -2430     
- Partials       11      544     +533     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@@ -1,7 +1,3 @@
import process from 'node:process'

export const isBelowNode18 = Number(process.version.slice(1).split('.')[0]) < 18
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't run CI on Node18 now.

removeEventListener: vi.fn(),
dispatchEvent: vi.fn(),
}))
const matchMediaSpy = vi.spyOn(window, 'matchMedia')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I mock matchMedia globally or move this file to browser.test.ts?

@9romise 9romise marked this pull request as draft November 5, 2025 11:41
@9romise
Copy link
Member Author

9romise commented Nov 5, 2025

It looks like there's an issue with the test coverage. I'll take a look.

@userquin
Copy link
Contributor

userquin commented Nov 5, 2025

why codecov still with previous old run here #5141 (comment)?

@9romise
Copy link
Member Author

9romise commented Nov 5, 2025

It is still failing, the coverage files are empty.

Comment on lines 96 to +102
include: [
'!packages/**/*.{browser,server}.{test,spec}.ts',
'packages/**/*.{test,spec}.ts',
'test/*.{test,spec}.ts',
],
exclude: [
'packages/**/*.{browser,server}.{test,spec}.ts',
],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally! The coverage failure was caused by this line, which relates to vitest's migration of coverage calculation from test-exclude to picomatch. I haven't looked into it deeply for now, but if I get the chance, I'll open an issue or PR for vitest.

Copy link
Contributor

@userquin userquin Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, Vitest should have added a fix => move all include entries that begin with ! to the exclude

This reverts commit cb8ec13.
@9romise
Copy link
Member Author

9romise commented Nov 5, 2025

The tests are still failing due to getComputedStyle, and the issue isn't consistently reproducible. 😕

@userquin
Copy link
Contributor

userquin commented Nov 5, 2025

The tests are still failing due to getComputedStyle, and the issue isn't consistently reproducible. 😕

cannot pin jsdom to 20.0.3?

@9romise
Copy link
Member Author

9romise commented Nov 5, 2025

The tests are still failing due to getComputedStyle, and the issue isn't consistently reproducible. 😕

cannot pin jsdom to 20.0.3?

Yes, this didn't resolve the issue and even introduced more errors. See https://github.com/vueuse/vueuse/actions/runs/19108005315/job/54597101035?pr=5141

@userquin
Copy link
Contributor

userquin commented Nov 5, 2025

Yes, this didn't resolve the issue and even introduced more errors

arggg, I'll check it in ~ 1 hour 🤞

@9romise
Copy link
Member Author

9romise commented Nov 5, 2025

While the tests are passing after bumping jsdom to 27.1.0 now, but I suspect the underlying issue hasn't actually been fixed. 🤔

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

Labels

dependencies Pull requests that update a dependency file size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants