grammarly icon indicating copy to clipboard operation
grammarly copied to clipboard

Error: Cannot find module 'node:perf_hooks'

Open semaphore-egg opened this issue 2 years ago • 4 comments

The latest version raises the following exceptions:

internal/modules/cjs/loader.js:937
  throw err;
  ^

Error: Cannot find module 'node:perf_hooks'
Require stack:
- /home/kd/.vscode/extensions/znck.grammarly-0.23.8/dist/server/index.node.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:934:15)
    at Module._load (internal/modules/cjs/loader.js:779:27)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
    at Module.require (internal/modules/cjs/loader.js:1006:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at /home/kd/.vscode/extensions/znck.grammarly-0.23.8/dist/server/index.node.js:38:3661
    at /home/kd/.vscode/extensions/znck.grammarly-0.23.8/dist/server/index.node.js:2:245
    at Object.<anonymous> (/home/kd/.vscode/extensions/znck.grammarly-0.23.8/dist/server/index.node.js:64:604)
    at Module._compile (internal/modules/cjs/loader.js:1125:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1155:10) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/kd/.vscode/extensions/znck.grammarly-0.23.8/dist/server/index.node.js'
  ]
}
[Error - 10:04:36 PM] Connection to server got closed. Server will not be restarted.

version == v0.14.0 seems do not have such problems.

node version is:

> node -v
v16.14.0
> npm -v
8.3.1

system information

> uname -v
#44~20.04.1-Ubuntu SMP Fri Jun 24 13:27:29 UTC 2022

Update 1 Updating Vscode to 1.70.0, the error disappear but the extension still do not work.

Version: 1.70.0
Commit: da76f93349a72022ca4670c1b84860304616aaa2
Date: 2022-08-04T04:38:48.541Z
Electron: 18.3.5
Chromium: 100.0.4896.160
Node.js: 16.13.2
V8: 10.0.139.17-electron.0
OS: Linux x64 5.15.0-43-generic

Update 2 It seems that latest version works in vscode 1.70.0 under ubuntu 20.04. But I have to manually trigger ctrl+shift+p for the restart language server command and make some restart on the vscode. Will come back here if I get some news.

semaphore-egg avatar Jul 24 '22 14:07 semaphore-egg

I have the same problem in Version 0.22.1 on MacOS (Monterey, 12.4) with Node v18.6.0 installed through brew

lacinoire avatar Jul 25 '22 13:07 lacinoire

Duplicate of #264.

jcs090218 avatar Aug 09 '22 06:08 jcs090218

Duplicate of #264.

Are there any solutions so far? It seems there is something wrong with the version > 0.14. Updating to the latest version does not solve the problem.

semaphore-egg avatar Aug 12 '22 08:08 semaphore-egg

using v0.22.1 I updated to vscode 1.70.2 from 1.70.1 and now the extension starts (no more perf error as with 1.70.1), but now getting Page Not Found when logging in for the callback that tries to use the netlify function at https://vscode-extension-grammarly.netlify.app/.netlify/functions/redirect - however I appear to be logged in. So that just be a UX problem.

twofingerrightclick avatar Aug 18 '22 17:08 twofingerrightclick