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

Error: Cannot find module 'vscode-languageserver-protocol' #1154

Closed
michaelpumo opened this issue Apr 10, 2022 · 1 comment
Closed

Error: Cannot find module 'vscode-languageserver-protocol' #1154

michaelpumo opened this issue Apr 10, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@michaelpumo
Copy link

I'm using vue-tsc in a Vite project.

Error when running my library build:

vite v2.9.1 building for production...
✓ 2 modules transformed.
dist/components-vue.es.js   0.66 KiB / gzip: 0.36 KiB
dist/components-vue.umd.js   0.70 KiB / gzip: 0.42 KiB
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'vscode-languageserver-protocol'
Require stack:
- /Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/@volar/shared/out/requests.js
- /Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/@volar/shared/out/browser.js
- /Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/@volar/shared/out/node.js
- /Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/@volar/pug-language-service/out/baseParse.js
- /Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/@volar/pug-language-service/out/pugDocument.js
- /Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/@volar/pug-language-service/out/index.js
- /Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/@volar/vue-typescript/out/plugins/pug.js
- /Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/@volar/vue-typescript/out/typescriptRuntime.js
- /Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/@volar/vue-typescript/out/index.js
- /Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/vue-tsc/out/proxy.js
- /Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/typescript/lib/tsc.js
- /Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/vue-tsc/bin/vue-tsc.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/@volar/shared/out/requests.js:4:16)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/@volar/shared/out/requests.js',
    '/Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/@volar/shared/out/browser.js',
    '/Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/@volar/shared/out/node.js',
    '/Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/@volar/pug-language-service/out/baseParse.js',
    '/Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/@volar/pug-language-service/out/pugDocument.js',
    '/Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/@volar/pug-language-service/out/index.js',
    '/Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/@volar/vue-typescript/out/plugins/pug.js',
    '/Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/@volar/vue-typescript/out/typescriptRuntime.js',
    '/Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/@volar/vue-typescript/out/index.js',
    '/Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/vue-tsc/out/proxy.js',
    '/Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/typescript/lib/tsc.js',
    '/Users/paranoidandroid/Documents/websites/GOTG.Web.Components.Vue/node_modules/vue-tsc/bin/vue-tsc.js'
  ]
}

package.json

{
  "name": "components-vue",
  "private": true,
  "version": "0.0.1",
  "types": "./dist/main.d.ts",
  "files": [
    "dist"
  ],
  "main": "./dist/components-vue.umd.js",
  "module": "./dist/components-vue.es.js",
  "exports": {
    ".": {
      "import": "./dist/components-vue.es.js",
      "require": "./dist/components-vue.umd.js"
    }
  },
  "scripts": {
    "dev": "vite",
    "build": "vite build && vue-tsc --emitDeclarationOnly && mv dist/src dist/types",
    "preview": "vite preview"
  },
  "dependencies": {
    "vue": "^3.2.31"
  },
  "devDependencies": {
    "@types/node": "^17.0.23",
    "@vitejs/plugin-vue": "^2.3.1",
    "typescript": "^4.6.3",
    "vite": "^2.9.1",
    "vue-tsc": "^0.34.1"
  }
}

This started happening after upgrading from:
"vue-tsc": "^0.33.9"

@antfu
Copy link
Member

antfu commented Apr 10, 2022

Repro on Vitesse: https://github.com/antfu/vitesse/runs/5958564674?check_suite_focus=true

@johnsoncodehk johnsoncodehk added the bug Something isn't working label Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants