Skip to content

Conversation

@hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Dec 22, 2025

Description

Resolves #9285

This PR surfaces ErrorEvent.message on console, but notably this still keeps them as non unhandled errors.

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.
  • Please check Allow edits by maintainers to make review process faster. Note that this option is not available for repositories that are owned by Github organizations.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

@netlify
Copy link

netlify bot commented Dec 22, 2025

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 9a1ba85
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/694904590e85180008ddeaf7
😎 Deploy Preview https://deploy-preview-9322--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hi-ogawa hi-ogawa changed the title fix(browser): log unhandled ErrorEvent.message fix(browser): log ErrorEvent.message when ErrorEvent.error is null Dec 22, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 22, 2025

@vitest/browser

npm i https://pkg.pr.new/@vitest/browser@9322

@vitest/browser-playwright

npm i https://pkg.pr.new/@vitest/browser-playwright@9322

@vitest/browser-preview

npm i https://pkg.pr.new/@vitest/browser-preview@9322

@vitest/browser-webdriverio

npm i https://pkg.pr.new/@vitest/browser-webdriverio@9322

@vitest/coverage-istanbul

npm i https://pkg.pr.new/@vitest/coverage-istanbul@9322

@vitest/coverage-v8

npm i https://pkg.pr.new/@vitest/coverage-v8@9322

@vitest/expect

npm i https://pkg.pr.new/@vitest/expect@9322

@vitest/mocker

npm i https://pkg.pr.new/@vitest/mocker@9322

@vitest/pretty-format

npm i https://pkg.pr.new/@vitest/pretty-format@9322

@vitest/runner

npm i https://pkg.pr.new/@vitest/runner@9322

@vitest/snapshot

npm i https://pkg.pr.new/@vitest/snapshot@9322

@vitest/spy

npm i https://pkg.pr.new/@vitest/spy@9322

@vitest/ui

npm i https://pkg.pr.new/@vitest/ui@9322

@vitest/utils

npm i https://pkg.pr.new/@vitest/utils@9322

vitest

npm i https://pkg.pr.new/vitest@9322

@vitest/web-worker

npm i https://pkg.pr.new/@vitest/web-worker@9322

@vitest/ws-client

npm i https://pkg.pr.new/@vitest/ws-client@9322

commit: b2fd44e

@hi-ogawa hi-ogawa changed the title fix(browser): log ErrorEvent.message when ErrorEvent.error is null fix(browser): log ErrorEvent.message when unhandled ErrorEvent.error is null Dec 22, 2025
@hi-ogawa hi-ogawa marked this pull request as ready for review December 22, 2025 09:32
}
else {
console.error(e[prop])
// `ErrorEvent` doesn't necessary have `ErrotEvent.error` defined
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// `ErrorEvent` doesn't necessary have `ErrotEvent.error` defined
// `ErrorEvent` doesn't necessary have `ErrorEvent.error` defined

{ browser: 'firefox' },
{ browser: 'webkit' },
// hard to webkit on some linux distributions
...(process.env.BROWSER_NO_WEBKIT ? [] : [{ browser: 'webkit' as const }]),
Copy link
Member

Choose a reason for hiding this comment

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

I don't see this being set anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is for me to run test locally by BROWSER_NO_WEBKIT=1 pnpm -C test/browser ... commands as I cannot setup playwright on Archlinux.

@sheremet-va sheremet-va merged commit 5d84eeb into vitest-dev:main Dec 23, 2025
16 of 17 checks passed
@hi-ogawa hi-ogawa deleted the 12-22-fix_browser_check_errorevent_as_unhandled_error branch December 24, 2025 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ResizeObserver infinite loop causes null being logged

3 participants