microsoft / powerplatform-vscode

The Power Platform VSCode extension makes it easy to manage Power Platform environments and allows the developer to create, build and deploy Power Platform solutions, packages and portals.
MIT License
210 stars 38 forks source link

PowerApps HTML Language Server Crashing #893

Open daniel-schroeder-dev opened 8 months ago

daniel-schroeder-dev commented 8 months ago

Anytime I open an HTML file in VS Code, I'm seeing this error:

power-apps-html-language-server-crashing

It started happening on the latest version release (v2.0.41).

I'm also on the latest version of VS Code:

vs-code-version

Here's what I see in the console:

node:internal/modules/cjs/loader:1087
  throw err;
  ^

Error: Cannot find module 'vscode'
Require stack:
- c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js
    at Function._resolveFilename (node:internal/modules/cjs/loader:1084:15)
    at node:internal/modules/cjs/loader:929:27
    at Function._load (node:electron/js2c/node_init:2:13357)
    at Module.require (node:internal/modules/cjs/loader:1150:19)
    at require (node:internal/modules/cjs/helpers:121:18)
    at Object.vscode (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:38502:18)
    at __webpack_require__ (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:47284:42)
    at ./src/common/Utils.ts (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:28024:29)
    at __webpack_require__ (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:47284:42)
    at ./src/common/OneDSLoggerTelemetry/oneDSLoggerWrapper.ts (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:27528:17) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'c:\\Users\\dschro1\\.vscode\\extensions\\microsoft-isvexptools.powerplatform-vscode-2.0.41\\dist\\htmlServer.js'
  ]
}

Node.js v18.17.1
[Info  - 5:43:23 PM] Connection to server got closed. Server will restart.
node:internal/modules/cjs/loader:1087
  throw err;
  ^

Error: Cannot find module 'vscode'
Require stack:
- c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js
    at Function._resolveFilename (node:internal/modules/cjs/loader:1084:15)
    at node:internal/modules/cjs/loader:929:27
    at Function._load (node:electron/js2c/node_init:2:13357)
    at Module.require (node:internal/modules/cjs/loader:1150:19)
    at require (node:internal/modules/cjs/helpers:121:18)
    at Object.vscode (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:38502:18)
    at __webpack_require__ (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:47284:42)
    at ./src/common/Utils.ts (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:28024:29)
    at __webpack_require__ (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:47284:42)
    at ./src/common/OneDSLoggerTelemetry/oneDSLoggerWrapper.ts (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:27528:17) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'c:\\Users\\dschro1\\.vscode\\extensions\\microsoft-isvexptools.powerplatform-vscode-2.0.41\\dist\\htmlServer.js'
  ]
}

Node.js v18.17.1
[Info  - 5:43:23 PM] Connection to server got closed. Server will restart.
node:internal/modules/cjs/loader:1087
  throw err;
  ^

Error: Cannot find module 'vscode'
Require stack:
- c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js
    at Function._resolveFilename (node:internal/modules/cjs/loader:1084:15)
    at node:internal/modules/cjs/loader:929:27
    at Function._load (node:electron/js2c/node_init:2:13357)
    at Module.require (node:internal/modules/cjs/loader:1150:19)
    at require (node:internal/modules/cjs/helpers:121:18)
    at Object.vscode (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:38502:18)
    at __webpack_require__ (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:47284:42)
    at ./src/common/Utils.ts (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:28024:29)
    at __webpack_require__ (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:47284:42)
    at ./src/common/OneDSLoggerTelemetry/oneDSLoggerWrapper.ts (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:27528:17) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'c:\\Users\\dschro1\\.vscode\\extensions\\microsoft-isvexptools.powerplatform-vscode-2.0.41\\dist\\htmlServer.js'
  ]
}

Node.js v18.17.1
[Info  - 5:43:24 PM] Connection to server got closed. Server will restart.
node:internal/modules/cjs/loader:1087
  throw err;
  ^

Error: Cannot find module 'vscode'
Require stack:
- c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js
    at Function._resolveFilename (node:internal/modules/cjs/loader:1084:15)
    at node:internal/modules/cjs/loader:929:27
    at Function._load (node:electron/js2c/node_init:2:13357)
    at Module.require (node:internal/modules/cjs/loader:1150:19)
    at require (node:internal/modules/cjs/helpers:121:18)
    at Object.vscode (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:38502:18)
    at __webpack_require__ (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:47284:42)
    at ./src/common/Utils.ts (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:28024:29)
    at __webpack_require__ (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:47284:42)
    at ./src/common/OneDSLoggerTelemetry/oneDSLoggerWrapper.ts (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:27528:17) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'c:\\Users\\dschro1\\.vscode\\extensions\\microsoft-isvexptools.powerplatform-vscode-2.0.41\\dist\\htmlServer.js'
  ]
}

Node.js v18.17.1
[Info  - 5:43:24 PM] Connection to server got closed. Server will restart.
node:internal/modules/cjs/loader:1087
  throw err;
  ^

Error: Cannot find module 'vscode'
Require stack:
- c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js
    at Function._resolveFilename (node:internal/modules/cjs/loader:1084:15)
    at node:internal/modules/cjs/loader:929:27
    at Function._load (node:electron/js2c/node_init:2:13357)
    at Module.require (node:internal/modules/cjs/loader:1150:19)
    at require (node:internal/modules/cjs/helpers:121:18)
    at Object.vscode (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:38502:18)
    at __webpack_require__ (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:47284:42)
    at ./src/common/Utils.ts (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:28024:29)
    at __webpack_require__ (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:47284:42)
    at ./src/common/OneDSLoggerTelemetry/oneDSLoggerWrapper.ts (c:\Users\dschro1\.vscode\extensions\microsoft-isvexptools.powerplatform-vscode-2.0.41\dist\htmlServer.js:27528:17) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'c:\\Users\\dschro1\\.vscode\\extensions\\microsoft-isvexptools.powerplatform-vscode-2.0.41\\dist\\htmlServer.js'
  ]
}

Node.js v18.17.1
[Error - 5:43:25 PM] Connection to server got closed. Server will not be restarted.
wsot commented 7 months ago

I'm experiencing the same issue but with the PowerApps Yaml Language Server

VS Code version:

Version: 1.88.0 (Universal)
Commit: 5c3e652f63e798a5ac2f31ffd0d863669328dc4c
Date: 2024-04-03T13:28:18.899Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Darwin arm64 23.3.0

Power Platform tools version v2.0.41

Error message: image

Console output:

Node.js v18.18.2
[Info  - 09:56:49] Connection to server got closed. Server will restart.
node:internal/modules/cjs/loader:1087
  throw err;
  ^

Error: Cannot find module 'vscode'
Require stack:
- /Users/---/.vscode/extensions/microsoft-isvexptools.powerplatform-vscode-2.0.41/dist/yamlServer.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1084:15)
    at Module._load (node:internal/modules/cjs/loader:929:27)
    at c._load (node:electron/js2c/node_init:2:13672)
    at Module.require (node:internal/modules/cjs/loader:1150:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.vscode (/Users//---/.vscode/extensions/microsoft-isvexptools.powerplatform-vscode-2.0.41/dist/yamlServer.js:34335:18)
    at __webpack_require__ (/Users//---/.vscode/extensions/microsoft-isvexptools.powerplatform-vscode-2.0.41/dist/yamlServer.js:43095:42)
    at ./src/common/Utils.ts (/Users//---/.vscode/extensions/microsoft-isvexptools.powerplatform-vscode-2.0.41/dist/yamlServer.js:24348:29)
    at __webpack_require__ (/Users//---/.vscode/extensions/microsoft-isvexptools.powerplatform-vscode-2.0.41/dist/yamlServer.js:43095:42)
    at ./src/common/OneDSLoggerTelemetry/oneDSLoggerWrapper.ts (/Users//---/.vscode/extensions/microsoft-isvexptools.powerplatform-vscode-2.0.41/dist/yamlServer.js:23852:17) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users//---/.vscode/extensions/microsoft-isvexptools.powerplatform-vscode-2.0.41/dist/yamlServer.js'
  ]
}

Node.js v18.18.2
[Error - 09:56:50] Connection to server got closed. Server will not be restarted.

To attempt to resolve it (unsuccessfully) I have:

ericasw28 commented 6 months ago

Same here. I won't repost what you guys have posted, I'm getting the exact same messages. No idea how to solve it...

jvndrlnd commented 6 months ago

Same issue for me with the PowerApps Yaml Language Server

MarkMcDonald commented 6 months ago

Getting the same "Error: Cannot find module 'vscode'" whenever I open VSCode with the Power Platform Tools (v2.0.49) installed.

Version: 1.89.1 (user setup) Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685 Date: 2024-05-07T05:13:33.891Z Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Windows_NT x64 10.0.22631

I'm presuming VSCode uses its own version of Node based on the above, as I'm using nvm for windows and my general node version is currently set to 14.15.1 for a client project. Don't really enough about how VSCode or Extensions for it are built to know if this is something that can be resolved by the end user - just know it is webpack and node so best avoided if you want to keep your sanity ;)

noorsyyed commented 4 months ago

i'm also experiencing the same issue

tc-wood commented 1 month ago

Experiencing this problem too