Did a fresh install of the docker image and keep running into the following error:
Running the contributed command: 'emmet.expandAbbreviation' failed.
My only setting is:
{
"emmet.triggerExpansionOnTab": true
}
No other extensions installed/enabled. Straight from installation to opening a new html file and trying to expand
!
or
ul>li*5
results in that error.
Current version details:
I tried this out with the codercom/code-server:3.4.0 Docker image but it's working for me. Does VS Code give you any extra information about why the command failed? It might help to check the output panel and look for logs under the extension host in addition to anything in the browser console.
Thanks for the tip.
Here's the output from Log (Remote Extension Host). I've also tried updating the node installation to v12.18.3
[2020-08-11 15:54:20.929] [exthost] [error] [vscode.emmet] provider FAILED
[2020-08-11 15:54:20.931] [exthost] [error] Error: Cannot find module 'vscode-emmet-helper'
Require stack:
- /node_modules/code-server/lib/vscode/extensions/emmet/dist/extension.js
- /node_modules/code-server/lib/vscode/out/vs/loader.js
- /node_modules/code-server/lib/vscode/out/bootstrap-amd.js
- /node_modules/code-server/lib/vscode/out/bootstrap-fork.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
at Function.Module._load (internal/modules/cjs/loader.js:842:27)
at Function.t._load (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:956:846)
at Function.n._load (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:926:106)
at Function.i._load (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:922:391)
at Module.require (internal/modules/cjs/loader.js:1026:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/node_modules/code-server/lib/vscode/extensions/emmet/dist/extension.js:1:59931)
at n (/node_modules/code-server/lib/vscode/extensions/emmet/dist/extension.js:1:158)
at Object.t.getEmmetHelper (/node_modules/code-server/lib/vscode/extensions/emmet/dist/extension.js:1:3341)
at t.DefaultCompletionItemProvider.provideCompletionItemsInternal (/node_modules/code-server/lib/vscode/extensions/emmet/dist/extension.js:1:53050)
at t.DefaultCompletionItemProvider.provideCompletionItems (/node_modules/code-server/lib/vscode/extensions/emmet/dist/extension.js:1:52275)
at /node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:675:521
at /node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:51:988
at new Promise (<anonymous>)
at Object.t.asPromise (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:51:960)
at H.provideCompletionItems (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:675:492)
at /node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:694:883
at e._withAdapter (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:685:862)
at e.$provideCompletionItems (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:694:861)
at e._doInvokeHandler (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:790:363)
at e._invokeHandler (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:790:55)
at e._receiveRequest (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:788:688)
at e._receiveOneMessage (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:787:518)
at /node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:785:754
at e.fire (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46:67)
at v.fire (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:232:615)
at /node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:958:347
at e.fire (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46:67)
at v.fire (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:232:615)
at t.PersistentProtocol._receiveMessage (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:237:17)
at /node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:234:155
at e.fire (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46:67)
at p.acceptChunk (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:230:129)
at /node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:229:483
at e.fire (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46:67)
at f._acceptChunk (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:241:182)
at /node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:239:346
at Socket.t (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:238:565)
at Socket.emit (events.js:315:20)
at addChunk (_stream_readable.js:295:12)
at readableAddChunk (_stream_readable.js:271:9)
at Socket.Readable.push (_stream_readable.js:212:10)
at TCP.onStreamRead (internal/stream_base_commons.js:186:23)
[2020-08-11 15:55:01.133] [exthost] [error] TypeError: s.updateExtensionsPath is not a function
at c (/node_modules/code-server/lib/vscode/extensions/emmet/dist/extension.js:1:2978)
at Object.t.getEmmetHelper (/node_modules/code-server/lib/vscode/extensions/emmet/dist/extension.js:1:3348)
at Object.t.expandEmmetAbbreviation (/node_modules/code-server/lib/vscode/extensions/emmet/dist/extension.js:1:41608)
at /node_modules/code-server/lib/vscode/extensions/emmet/dist/extension.js:1:48572
at e._executeContributedCommand (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:627:753)
at e.$executeContributedCommand (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:628:104)
at e._doInvokeHandler (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:790:363)
at e._invokeHandler (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:790:55)
at e._receiveRequest (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:788:739)
at e._receiveOneMessage (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:787:518)
at /node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:785:754
at e.fire (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46:67)
at v.fire (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:232:615)
at /node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:958:347
at e.fire (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46:67)
at v.fire (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:232:615)
at t.PersistentProtocol._receiveMessage (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:237:17)
at /node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:234:155
at e.fire (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46:67)
at p.acceptChunk (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:230:129)
at /node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:229:483
at e.fire (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46:67)
at f._acceptChunk (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:241:182)
at /node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:239:346
at Socket.t (/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:238:565)
at Socket.emit (events.js:315:20)
at addChunk (_stream_readable.js:295:12)
at readableAddChunk (_stream_readable.js:271:9)
at Socket.Readable.push (_stream_readable.js:212:10)
at TCP.onStreamRead (internal/stream_base_commons.js:186:23) emmet.expandAbbreviation
It looks like one of the dependencies for the extension is missing. It doesn't look like our image since we put code-server in /usr/lib/code-server. How did you install code-server?
There should be a directory at /node_modules/code-server/lib/vscode/extensions/emmet/node_modules/vscode-emmet-helper. For example here's what our 3.4.0 Docker image has:
ls -la /usr/lib/code-server/lib/vscode/extensions/emmet/node_modules/
total 8
drwxr-xr-x 6 root root 6 May 28 02:19 .
drwxr-xr-x 5 root root 8 May 28 02:20 ..
drwxr-xr-x 3 root root 3 May 28 02:19 @emmetio
drwxr-xr-x 3 root root 10 May 28 02:20 jsonc-parser
drwxr-xr-x 4 root root 9 May 28 02:20 vscode-emmet-helper
drwxr-xr-x 3 root root 7 May 28 02:20 vscode-languageserver-types
One workaround is to manually install the missing dependency:
cd /node_modules/code-server/lib/vscode/extensions/emmet
yarn
Please try using the latest version anyway. v3.4.1.
Thanks y'all. You're right @code-asher , this isn't the image direct from cdr. I'm using this docker image: https://github.com/linuxserver/docker-code-server
I initially thought it was a code-server problem but it may be a problem with that linuxserver docker instead or how it's being installed with Unraid... Just odd other folks haven't ran into a similar problem on such a popular feature.
In any case, thanks for the help.
@code-asher @nhooyr
linuxserver team member here
We install code-server via yarn --production global add code-server@"$CODE_VERSION" as seen here: https://github.com/linuxserver/docker-code-server/blob/master/Dockerfile#L42-L49 as instructed in your docs: https://github.com/cdr/code-server/blob/master/doc/install.md#yarn-npm
But that doesn't seem to compile the modules like emmet. Is there a recommended way to have everything compiled?
By the way, the reason we don't have 3.4.1 is because the naming convention issue with the latest github stable release breaks our ci, so we decided to skip that release. We didn't realize it would be quite a long time before the next release.
EDIT: As a test, I built a local image for 3.4.1 and that has more related issues. It seems spdlog is also not compiled and generates errors in the log when code-server is started
Sounds like our npm package needs some work!
Very weird, the .deb is generated from taking then npm package and installing it so if there is a bug with the npm package, it should occur in our Dockerfile as well.
Only difference seems to be we're passing --frozen-lockfile as well to yarn.
Oh wait is it because we delete scripts from VS Code's package.json so there's no postinstall step that installs the extension dependencies?
Oh wait is it because we delete scripts from VS Code's package.json so there's no postinstall step that installs the extension dependencies?
We do it ourselves afterwards.
My point is that it's unlikely there's something wrong with the build process otherwise we'd be seeing many reports of the same issue with our standalone releases as well right.
I mean there's nothing that moves into the extension directories (like extensions/emmet) and installs their node modules as well.
Since I think that's in the main postinstall and not the one in extensions.
One idea would be to cd into each extension directory and run yarn --production --frozen-lockfile.
As for why this happens, maybe the npm publishing process leaves out any directories called node_modules? So even though extensions/emmet/node_modules exists it might be getting stripped out in the published npm module.
I mean there's nothing that moves into the extension directories (like extensions/emmet) and installs their node modules as well.
Ahhh true, I guess we're that at some point early in the build process! Probably when building VS Code.
@aptalca Best if you guys switch to our install script for now as that'll use a .deb which will have the proper dependencies.
We can't do the deb because you don't publish an arm32 package
I'll dig into your build process to see if I can figure it out
I dug in a little bit more. Switched to using --frozen-lockfile, which changes the path for node_modules to somewhere under /usr/local/share, and it fixes an issue with the terminal not starting. However, emmet is still not functional. I also tried these steps: https://github.com/cdr/code-server/blob/acf098484d33d6f159f1f29d75587a4ff7c0a94b/ci/build/npm-postinstall.sh#L35-L45 and that did not help.
Looking at the earlier comment about running yarn in the emmet folder, when I do that, the node_modules folder is created in there, but there is no vscode-emmet-helper in that folder.
Ah yup, looks like VS Code strips the dependencies from the extension package.json so yarn installs nothing: https://github.com/cdr/code-server/pull/2041#issuecomment-685910322
@nhooyr @code-asher thanks guys, I can confirm that these built in extensions now work with an npm/yarn install of 3.6.0
@tonywu3 emmet abbrev is working out of the box now on the latest
Thanks everyone for your hard work!