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.

Unexpected response from worker

See original GitHub issue

Hi,

Do you want to request a feature or report a bug? Report a bug

What is the current behavior? A bunch of test fail after several passed test

If the current behavior is a bug, please provide the steps to reproduce and either a repl.it demo through https://repl.it/languages/jest or a minimal repository on GitHub that we can yarn install and yarn test.

Users/sebastien/project/node_modules/jest-worker/build/worker.js:169
        throw new TypeError('Unexpected response from worker: ' + response[0]);
        ^

TypeError: Unexpected response from worker: undefined
    at _receive (/Users/sebastien/project/node_modules/jest-worker/build/worker.js:169:15)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at process.nextTick (internal/child_process.js:744:12)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
error Command failed with exit code 1.

I don’t know how I can give you more information, but please ask 🙏

What is the expected behavior?

Run all the tests

Please provide your exact Jest configuration

Run npx envinfo --preset jest in your project directory and paste the results here

  System:
    OS: macOS Sierra 10.12.6
    CPU: x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
  Binaries:
    Node: 6.9.5
    Yarn: 1.3.2
    npm: 4.6.1
  npmPackages:
    jest:
      wanted: ^22.4.0
      installed: 22.4.3

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mjesuncommented, Mar 30, 2018

To be fair, I don’t think that’s something you should be addressing. jest-environment-node creates, via jest-util, a deep copy of the process object, to be used as a fake/mock process object inside the context. But our deepCopy implementation just references functions, so you end up with the real process.send.

The reason why no one noticed it is because this API is not usually used, and in our case (which we use), we have to mock process.send to assert that jest-worker does what is expected. 😄

I’ve set up #5904 as a fix for the issue, but I’m not sure when it will be merged/released. We’re already in a jest@23 alpha release, and it’s easter holidays. But I’ll make my best to have something shipped soon. 🙂

1reaction
iGitScorcommented, Mar 30, 2018

Wow, awesome! That’s exactly the point. We use pmx which wasn’t mocked and which calls process.send function. Do you now if there is a known mock for process.send ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] jest-worker TypeError: Unexpected response from ...
In Next.js source code there is the line that causes tsnd to crash upon using jest workers launched with {enableWorkerThreads: false} options.
Read more >
Gatsby Build Error "TypeError: Unexpected response from ...
Gatsby Build Error "TypeError: Unexpected response from worker: undefined" Hello, I'm trying to get a site deployed and just catching up on the...
Read more >
Getting error on gatsby build command: TypeError ...
I am getting this error when I run the command $ gatsby build on the terminal. What gets my attention on this one...
Read more >
An unexpected response was received from the server.
When i launch the compression of the images after some seconds i receive this message: “An unexpected response was received from the server.”....
Read more >
nextjs ts-node-dev TypeError: Unexpected response from worker
nextjs ts-node-dev TypeError: Unexpected response from worker: undefined ... Проблема в использовании ts-node-dev. ... "dev": "next dev",. чтобы ...
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