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

Module not found - 'vscode-css-languageservice/lib/umd/data/browsers' #28

Closed
jbalzar opened this issue Feb 24, 2020 · 13 comments · Fixed by #29
Closed

Module not found - 'vscode-css-languageservice/lib/umd/data/browsers' #28

jbalzar opened this issue Feb 24, 2020 · 13 comments · Fixed by #29
Labels
help wanted Extra attention is needed

Comments

@jbalzar
Copy link

jbalzar commented Feb 24, 2020

Hello! I just installed the extension but I'm getting issue. I'm not sure if this is related to the current extension but this is the output when I run :CocCommand workspace.showOutput

Error: Cannot find module 'vscode-css-languageservice/lib/umd/data/browsers'
Require stack:

  • /home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/modes/style/stylus/css-browser-data.js
  • /home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/modes/style/stylus/completion-item.js
  • /home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/modes/style/stylus/index.js
  • /home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/embeddedSupport/languageModes.js
  • /home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/services/vls.js
  • /home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/vueServerMain.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
    at Function.Module._load (internal/modules/cjs/loader.js:862:27)
    at Module.require (internal/modules/cjs/loader.js:1040:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object. (/home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/modes/style/stylus/css-browser-data.js:7:17)
    at Module._compile (internal/modules/cjs/loader.js:1151:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Module.require (internal/modules/cjs/loader.js:1040:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/modes/style/stylus/css-browser-data.js',
    '/home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/modes/style/stylus/completion-item.js',
    '/home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/modes/style/stylus/index.js',
    '/home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/embeddedSupport/languageModes.js',
    '/home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/services/vls.js',
    '/home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/vueServerMain.js'
    ]
@jbalzar
Copy link
Author

jbalzar commented Feb 25, 2020

I manage to fix it by editing directly the file in the package that is giving an issue.

~/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/modes/style/stylus/css-browser-data.js

from:
const rawData = require('vscode-css-languageservice/lib/umd/data/browsers').cssData;
to:
const rawData = require('vscode-css-languageservice/lib/umd/data/webCustomData').cssData;

I just rename the "browser" to "webCustomData".

Do you have any idea?

Thanks

@chemzqm
Copy link
Member

chemzqm commented Feb 25, 2020

No, can't reproduce.

@jbalzar
Copy link
Author

jbalzar commented Feb 25, 2020

Ok. I guess I'll leave it for now. Thanks!

@jbalzar jbalzar closed this as completed Feb 25, 2020
@gglynne
Copy link

gglynne commented Feb 25, 2020

i can confirm the same issue with version 1.1.7

@kthibodeaux
Copy link

Having the same issue, uninstalling all extensions and reinstalling just vetur still causes the issue. When I open a vue file and run :CocInfo I see the same stack trace.

@jbalzar
Copy link
Author

jbalzar commented Feb 25, 2020

@chemzqm Maybe you can take a look again?

@jbalzar jbalzar reopened this Feb 25, 2020
@chemzqm
Copy link
Member

chemzqm commented Feb 26, 2020

Don't know what happened with vue-language-server, it doesn't start at all with latest version.

@chemzqm chemzqm added the help wanted Extra attention is needed label Feb 26, 2020
@heroheman
Copy link

I manage to fix it by editing directly the file in the package that is giving an issue.

~/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/modes/style/stylus/css-browser-data.js

from:
const rawData = require('vscode-css-languageservice/lib/umd/data/browsers').cssData;
to:
const rawData = require('vscode-css-languageservice/lib/umd/data/webCustomData').cssData;

I just rename the "browser" to "webCustomData".

Do you have any idea?

Thanks

Had the same issue - worked for me. Looking forward to a fix!

@yaegassy
Copy link
Contributor

yaegassy commented Mar 2, 2020

This is a vue-language-server dependency bug.

See: vuejs/vetur#1730

Unfortunately, you will have to wait for the npm package to be updated.

@yaegassy
Copy link
Contributor

yaegassy commented Mar 5, 2020

@chemzqm

It seems that vue-language-server has been changed to vls.

See: https://github.com/vuejs/vetur/releases/tag/v0.24.0

vue-language-server deprecated and will be published as vls.

npm: https://www.npmjs.com/package/vls

@StrayDragon
Copy link

As @yaegassy said, some upstream changes have replaced the old language server, Now we have to switch to the new package and so far my solution is:

  1. Install the new vls:
$ yarn global add vls
  1. Get the vls root path:
$ yarn global dir
/home/<USER_NAME>/.config/yarn/global # like this, then join with /node_modules/vls
  1. Add this config to :CocConfig (Replace it with your vls path)
"vetur.dev.vlsPath": "/home/<USER_NAME>/.config/yarn/global/node_modules/vls",

Finally, I found that there are some deprecation warnings, but it works!

My :CocInfo:

## versions

vim version: NVIM v0.5.0-400-gad745f9da
node version: v12.16.1
coc.nvim version: 0.0.76-f4400f58ef
term: xterm-256color
platform: linux

...

## Output channel: vetur

Loaded bundled typescript@3.8.3.
Vetur initialized
{ parser: "babylon" } is deprecated; we now treat it as { parser: "babel" }.

@yaegassy
Copy link
Contributor

@chemzqm
Created PR to change from vue-language-server package to vls package.

@Herz3h
Copy link

Herz3h commented Mar 16, 2020

Same problem here. I can confirm @StrayDragon worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants