I restarted VSCode and since then I've been getting the following error:
Error: Cannot find module 'is-utf8'
at Function.Module._resolveFilename (module.js:543:15)
at Function.Module._load (module.js:473:25)
at Module.require (module.js:586:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/laurensbosscher/.vscode/extensions/flowtype.flow-for-vscode-0.8.4/node_modules/strip-bom/index.js:2:14)
at Object.<anonymous> (/Users/laurensbosscher/.vscode/extensions/flowtype.flow-for-vscode-0.8.4/node_modules/strip-bom/index.js:19:3)
at Module._compile (module.js:642:30)
at Object.Module._extensions..js (module.js:653:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:504:12)
[Info - 2:30:43 PM] Connection to server got closed. Server will restart.
module.js:545
throw err;
Disabling LSP does fix the error. Everything used to work until the extension was updated today. I've looked through the commits but unfortunately, I cannot explain where "is-utf8" or "strip-bom" is used in this extension.
Flow version:
flow version
Flow, a static type checker for JavaScript, version 0.80.0
VSCode version:
1.27.1 (1.27.1)
Thanks!
I've seen it earlier and mitigated it by running
cd ~/.vscode/extensions/flowtype.flow-for-vscode-0.8.4/
yarn
Thanks that took care of the problem!
I noticed that when hovering over the error it was blinking every second though, so I had to disable LSP as well.
I had the same issue even after turning LSP off and restarting, etc. Running yarn manually as @NameFILIP described mitigated the problem for me as well.
Yeah - this is pretty weird, there are no changes to the package.json (outside of a typo fix and version bump) in the last version
edit: nevermind, the error is coming from within a sub-dependency which I misread. The is-utf8 is there in yarn.lock.
The is-utf8 is not in the package.json dependencies of the installed plugin. The list is:
{
"name": "flow-for-vscode",
"version": "0.8.4",
"dependencies": {
"cross-spawn": "^4.0.0",
"dequeue": "^1.0.5",
"elegant-spinner": "^1.0.1",
"event-kit": "^2.0.0",
"flow-bin": "^0.68.0",
"flow-language-server": "^0.6.0",
"fs-plus": "^2.8.2",
"fuzzaldrin": "^2.1.0",
"js-beautify": "^1.6.12",
"lodash.debounce": "^4.0.8",
"log4js": "^0.6.37",
"lru-cache": "^4.0.1",
}
}
@NameFILIP
I've done this also but:
nuclide-flow-rpc - Flow IDE process stderr: Could not find a .flowconfig in . or any of its parent directories.
See "flow init --help" for more info
[31m[2018-11-15 21:34:58.544] [ERROR] nuclide-commons/process - [39mstream error on stream stdin with command: /home/theaifam5/.config/yarn/global/node_modules/flow-bin/flow-linux64-v0.86.0/flow [ 'ide',
The file does NOT exists btw, but I think ,this error message should be not printed as an error, but as a information that the file is missing or something.
Had this issue again and came back to this thread. Version is now 0.8.5 so I had to update the path in @NameFILIP's workaround:
cd ~/.vscode/extensions/flowtype.flow-for-vscode-0.8.5/
yarn
Update plugin to >= 1.0.0. It's fixed now.
Most helpful comment
I've seen it earlier and mitigated it by running