Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vscode emmet extension does not work anymore #5756

Closed
akosyakov opened this issue Jul 19, 2019 · 10 comments · Fixed by #5771
Closed

vscode emmet extension does not work anymore #5756

akosyakov opened this issue Jul 19, 2019 · 10 comments · Fixed by #5771
Assignees
Labels
bug bugs found in the application critical critical bugs / problems vscode issues related to VSCode compatibility

Comments

@akosyakov
Copy link
Member

akosyakov commented Jul 19, 2019

Uncaught Error: Cannot find module 'vscode-emmet-helper'

Error: Cannot find module 'vscode-emmet-helper'
    at Function.Module._resolveFilename (/internal/modules/cjs/loader.js:582)
    at Function.Module._load (/internal/modules/cjs/loader.js:508)
    at Function.module._load (/workspace/theia/packages/plugin-ext-vscode/lib/node/plugin-vscode-init.js:98)
    at Module.require (/internal/modules/cjs/loader.js:637)
    at require (/internal/modules/cjs/helpers.js:22)
    at Object.<anonymous> (/tmp/vscode-unpacked/vscode-builtin-emmet-0.1.0.tgz/package/dist/extension.js:1)
    at n (/tmp/vscode-unpacked/vscode-builtin-emmet-0.1.0.tgz/package/dist/extension.js:1)
    at Object.t.getEmmetHelper (/tmp/vscode-unpacked/vscode-builtin-emmet-0.1.0.tgz/package/dist/extension.js:1)
    at t.DefaultCompletionItemProvider.provideCompletionItemsInternal (/tmp/vscode-unpacked/vscode-builtin-emmet-0.1.0.tgz/package/dist/extension.js:1)
    at t.DefaultCompletionItemProvider.provideCompletionItems (/tmp/vscode-unpacked/vscode-builtin-emmet-0.1.0.tgz/package/dist/extension.js:1)
    at /vs/editor/editor.main.js:12536
/vs/editor/editor.main.js:12536 Uncaught Error: a.updateExtensionsPath is not a function

TypeError: a.updateExtensionsPath is not a function
    at c (/tmp/vscode-unpacked/vscode-builtin-emmet-0.1.0.tgz/package/dist/extension.js:1)
    at Object.t.getEmmetHelper (/tmp/vscode-unpacked/vscode-builtin-emmet-0.1.0.tgz/package/dist/extension.js:1)
    at t.DefaultCompletionItemProvider.provideCompletionItemsInternal (/tmp/vscode-unpacked/vscode-builtin-emmet-0.1.0.tgz/package/dist/extension.js:1)
    at t.DefaultCompletionItemProvider.provideCompletionItems (/tmp/vscode-unpacked/vscode-builtin-emmet-0.1.0.tgz/package/dist/extension.js:1)
    at CompletionAdapter.provideCompletionItems (/workspace/theia/packages/plugin-ext/lib/plugin/languages/completion.js:36)
    at /workspace/theia/packages/plugin-ext/lib/plugin/languages.js:149
    at LanguagesExtImpl.withAdapter (/workspace/theia/packages/plugin-ext/lib/plugin/languages.js:121)
    at LanguagesExtImpl.$provideCompletionItems (/workspace/theia/packages/plugin-ext/lib/plugin/languages.js:149)
    at RPCProtocolImpl.doInvokeHandler (/workspace/theia/packages/plugin-ext/lib/api/rpc-protocol.js:207)
    at RPCProtocolImpl.invokeHandler (/workspace/theia/packages/plugin-ext/lib/api/rpc-protocol.js:192)
    at /vs/editor/editor.main.js:12536

In order to reproduce, install it from https://registry.npmjs.org/@theia/vscode-builtin-emmet/-/vscode-builtin-emmet-0.2.1.tgz

@akosyakov akosyakov added bug bugs found in the application vscode issues related to VSCode compatibility labels Jul 19, 2019
@akosyakov akosyakov self-assigned this Jul 19, 2019
@akosyakov
Copy link
Member Author

akosyakov commented Jul 19, 2019

Something wrong with require function in the plugin host process, it cannot find a module although it is there. @evidolob @benoitf maybe you can have an idea which change could cause it. Trying to debug it in the meantime.

@akosyakov akosyakov added the critical critical bugs / problems label Jul 19, 2019
@benoitf
Copy link
Contributor

benoitf commented Jul 19, 2019

maybe unload of the cache #5514 ?

@akosyakov
Copy link
Member Author

@benoitf thanks, checking

@akosyakov
Copy link
Member Author

akosyakov commented Jul 19, 2019

@benoitf Why do we need to mess around with internal details on require function? I wonder why it was introduced? Someone redeploys another version of the same extension without reloading the window?

@akosyakov
Copy link
Member Author

yes, reverting #5514 helps

@akosyakov
Copy link
Member Author

Unfortunately, i could not find any test cases in PR introduced cache clean up or reasoning of introducing it. @benoitf @evidolob please provide, we need to know how we can change it without breaking

@benoitf
Copy link
Contributor

benoitf commented Jul 19, 2019

it's on che side inside containers, extensions are restarted in the same process (this is why there is a need of proper clean-up as in fact there are some memory leaks)
#4931

@akosyakov
Copy link
Member Author

akosyakov commented Jul 19, 2019

@benoitf the reason is this line: https://github.com/theia-ide/theia/blob/3587c237cacc638dc54ec19dc3eaa755c2e69fb5/packages/plugin-ext/src/hosted/node/plugin-host-rpc.ts#L115

Is it really necessary? If we remove it would you be able to verify that there are no memory leaks? It would be good what other contributors can test with vanilla Theia.

Also code looks a bit strange. I've looked at npm modules which do unloading, they are traversing module tree starting from the root and only delete loaded modules from the root instead of going over the whole cache, so they never touch unrelated records. Could we use decache instead: https://github.com/dwyl/decache/blob/master/decache.js#L26?

@akosyakov
Copy link
Member Author

I could not find here nodejs/node#8443 an advice to purge module exports.

akosyakov added a commit that referenced this issue Jul 19, 2019
- don't touch exports!
- traverse only modules loaded by the plugin, not the entire require cache

Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
@akosyakov
Copy link
Member Author

Unloading is not related, see #5760 (comment)

akosyakov added a commit that referenced this issue Jul 22, 2019
Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
akosyakov added a commit that referenced this issue Jul 22, 2019
Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
akosyakov added a commit that referenced this issue Jul 23, 2019
Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
akosyakov added a commit that referenced this issue Jul 23, 2019
Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application critical critical bugs / problems vscode issues related to VSCode compatibility
Projects
None yet
2 participants