question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jest Worker swallows exception with UnhandledPromiseRejectionWarning

See original GitHub issue

🐛 Bug Report

When running a task inside a Jest Worker, exceptions get swallowed and raised as UnhandledPromiseRejectionWarning, making it hard to debug.

To Reproduce

Clone this repo, and run the following:

yarn
yarn run production

Expected behavior

I should see an exception from css-minimizer-webpack-plugin complaining about this line (wrong variable interpolation). Instead, all I see is:

UnhandledPromiseRejectionWarning: DataCloneError: function destructLexErrorInfo() {
          // remove cyclic references added to error info:
          // info....<omitted>... } could not be cloned.
    at reportError (/Users/mattiagiuffrida/Development/sensortower/overseer/node_modules/jest-worker/build/workers/threadChild.js:100:32)
    at reportClientError (/Users/mattiagiuffrida/Development/sensortower/overseer/node_modules/jest-worker/build/workers/threadChild.js:84:10)

An issue has already been raised in https://github.com/webpack-contrib/css-minimizer-webpack-plugin/issues/113, but the team there advised this is an issue with jest-worker.

Link to repl or repo (highly encouraged)

https://github.com/mattiagiuffrida-st/css-minimizer-webpack-plugin-error See “To Reproduce” on how to run the failing script

envinfo

System:
    OS: macOS 11.5.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 14.15.4 - ~/.nvm/versions/node/v14.15.4/bin/node
    Yarn: 1.22.10 - ~/.nvm/versions/node/v14.15.4/bin/yarn
    npm: 6.14.10 - ~/.nvm/versions/node/v14.15.4/bin/npm

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:22
  • Comments:9

github_iconTop GitHub Comments

2reactions
kytosaicommented, Oct 2, 2021

Please fix issue, i have same problem 😦 !!!

2reactions
mattiagiuffrida-stcommented, Aug 12, 2021

Not sure why the Needs Repro label was added since I’ve provided reproduction steps 🤨

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I fail a test in Jest when an uncaught promise ...
The code I'm testing is throwing errors within promises resulting in an UnhandledPromiseRejectionWarning message being logged to the console.
Read more >
cannot send the message - the message port has been ...
"Checked exceptions are bad because programmers just abuse them by always catching them and dismissing them which leads to problems being hidden and...
Read more >
Changelog | skuba - GitHub Pages
The worker threads now correctly propagate an exit code and log errors instead of triggering an UnhandledPromiseRejectionWarning . format, lint: Limit Prettier ...
Read more >
storybookjs/storybook (Raised $170.00)
[Bug]: Does not work in a a project using yarn but not a git/subversion, or a git worktree ... `@storybook/addon-jest` does not show...
Read more >
Android action bar transparent programmatically
(node:621)= unhandledpromiserejectionwarning:= error:= failed= to= chrome!= ... false]); don't work authenticatecorea sync owin not hadling exception ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found