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 extension doesn't seem to be running, and so does its intellisense

See original GitHub issue

Environment

  1. node -v: [8.9.4]
  2. npm -v: [5.6.0]
  3. Operating system: [Windows 10 Pro]

Steps to Reproduce

Achiving intellisense for jest commands like in here:

Expected Behavior

getting the list of available methods from jest and get indication that Jest extension works, by seeing the Jest icon on the status bar

Actual Behavior

  1. Getting a defaultive different menu of options
  2. No Jest icon on the status bar no intellisense

Logs of Developers Tools Console

I’ve added "jest.pathToJest": "node_modules/.bin/jest" into settings.json

When ./vscode/settings.json is open I get this in the console:

`console.ts:123 [Extension Host] [2018-02-21T23:45:22.770Z] [INFO] nuclide - Path to Flow: flow
mainThreadExtensionService.ts:43 [flowtype.flow-for-vscode]Cannot read property 'document' of undefined
e.$onExtensionRuntimeError @ mainThreadExtensionService.ts:43
e._doInvokeHandler @ rpcProtocol.ts:174
e._invokeHandler @ rpcProtocol.ts:159
e._receiveRequest @ rpcProtocol.ts:108
e._receiveOneMessage @ rpcProtocol.ts:90
(anonymous) @ rpcProtocol.ts:33
(anonymous) @ rpcProtocol.ts:213
e.fire @ event.ts:142
(anonymous) @ ipc.net.ts:81
emitOne @ events.js:96
emit @ events.js:191
readableAddChunk @ _stream_readable.js:178
Readable.push @ _stream_readable.js:136
onread @ net.js:560
mainThreadExtensionService.ts:44 TypeError: Cannot read property 'document' of undefined
	at C:\Users\Suziz\.vscode\extensions\flowtype.flow-for-vscode-0.7.3\build\flowDiagnostics.js:351:58
	at e.fire (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:88:729)
	at e.$acceptModelChanged (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:624:197)
	at e._doInvokeHandler (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:584:983)
	at e._invokeHandler (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:584:701)
	at e._receiveRequest (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:583:836)
	at e._receiveOneMessage (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:583:605)
	at c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:582:671
	at c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:585:523
	at c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:87:459
e.$onExtensionRuntimeError @ mainThreadExtensionService.ts:44
e._doInvokeHandler @ rpcProtocol.ts:174
e._invokeHandler @ rpcProtocol.ts:159
e._receiveRequest @ rpcProtocol.ts:108
e._receiveOneMessage @ rpcProtocol.ts:90
(anonymous) @ rpcProtocol.ts:33
(anonymous) @ rpcProtocol.ts:213
e.fire @ event.ts:142
(anonymous) @ ipc.net.ts:81
emitOne @ events.js:96
emit @ events.js:191
readableAddChunk @ _stream_readable.js:178
Readable.push @ _stream_readable.js:136
onread @ net.js:560
mainThreadExtensionService.ts:43 [flowtype.flow-for-vscode]Cannot read property 'document' of undefined
e.$onExtensionRuntimeError @ mainThreadExtensionService.ts:43
e._doInvokeHandler @ rpcProtocol.ts:174
e._invokeHandler @ rpcProtocol.ts:159
e._receiveRequest @ rpcProtocol.ts:108
e._receiveOneMessage @ rpcProtocol.ts:90
(anonymous) @ rpcProtocol.ts:33
(anonymous) @ rpcProtocol.ts:213
e.fire @ event.ts:142
(anonymous) @ ipc.net.ts:81
emitOne @ events.js:96
emit @ events.js:191
readableAddChunk @ _stream_readable.js:178
Readable.push @ _stream_readable.js:136
onread @ net.js:560
mainThreadExtensionService.ts:44 TypeError: Cannot read property 'document' of undefined
	at C:\Users\Suziz\.vscode\extensions\flowtype.flow-for-vscode-0.7.3\build\flowDiagnostics.js:351:58
	at e.fire (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:88:729)
	at e.$acceptModelChanged (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:624:197)
	at e._doInvokeHandler (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:584:983)
	at e._invokeHandler (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:584:701)
	at e._receiveRequest (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:583:836)
	at e._receiveOneMessage (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:583:605)
	at c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:582:671
	at c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:585:523
	at c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:87:459
e.$onExtensionRuntimeError @ mainThreadExtensionService.ts:44
e._doInvokeHandler @ rpcProtocol.ts:174
e._invokeHandler @ rpcProtocol.ts:159
e._receiveRequest @ rpcProtocol.ts:108
e._receiveOneMessage @ rpcProtocol.ts:90
(anonymous) @ rpcProtocol.ts:33
(anonymous) @ rpcProtocol.ts:213
e.fire @ event.ts:142
(anonymous) @ ipc.net.ts:81
emitOne @ events.js:96
emit @ events.js:191
readableAddChunk @ _stream_readable.js:178
Readable.push @ _stream_readable.js:136
onread @ net.js:560
console.ts:123 [Extension Host] Error: Document version already has changed
	at C:\Users\Suziz\.vscode\extensions\naumovs.color-highlight-2.3.0\dist\extension.js:2903:17
	at <anonymous>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
rewebitcommented, Feb 22, 2018

I am experiencing this same issue on a laptop running Windows 10 Education, with VS code and this extension installed. There are two other developers who are running Macs and the extension works properly.

To eliminate any possible local configuration issues, we took the same project and brought it into an old Mac Mini. On the Mac Mini it works as expected. There is an issue with running this extension on a Windows 10 machine.

1reaction
stephtrcommented, Feb 22, 2018

The debug issue is indeed a side effect of my commit. As @tonyhallett said it searches now within jest instead of jest.cmd for the path to jest.js, but that wouldn’t be a problem. However the regex in JestExt.ts#504 is broken (the dollar sign is not escaped), which is why the detection fails.

@ueeieiie Your repository is working in my VS Code: jest Is it possible, that you doesn’t have the client folder opened but its parent/root directory? In that case “node_modules/.bin/jest” won’t work. The correct setting would be "jest.pathToJest": "client/node_modules/.bin/jest --projects \"client\"". However if your root project doesn’t contain jest as a (dev-)dependency, you have to start the task runner manually after launching VS Code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

vscode jest extension doesn't work properly - Stack Overflow
I dont get "Jest" icon on the bottom bar, which means the ext doesnt work properly. I still dont get the intellisense support...
Read more >
vscode-jest - Visual Studio Marketplace
If the extension can find the jest command, by default it will automatically run and monitor all tests in watch mode upon launch, ......
Read more >
Using VS Code for JavaScript - Artsy Engineering
It does this by having a generic VS Code Debug Protocol which lets extensions use their own processes to run the debugger. So...
Read more >
Using ES Modules (ESM) in Node.js: A Practical Guide (Part 1)
mjs extension and so Ctrl/Cmd+Clicking it won't work, and its built in intellisense doesn't work on it. Gotcha: VSCode doesn't like the .mjs ......
Read more >
Jest | WebStorm Documentation - JetBrains
You can run and debug tests with Jest right in WebStorm. ... next to the test in the editor with an option to...
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