Skip to content

Error: VirtualCode id must be lowercase: scriptSetupFormat #4497

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

Closed
davidmatter opened this issue Jun 24, 2024 · 12 comments · Fixed by #4498
Closed

Error: VirtualCode id must be lowercase: scriptSetupFormat #4497

davidmatter opened this issue Jun 24, 2024 · 12 comments · Fixed by #4498
Labels
bug Something isn't working

Comments

@davidmatter
Copy link
Collaborator

davidmatter commented Jun 24, 2024

Vue - Official extension or vue-tsc version

2.0.22

VSCode version

Vue version

3.4.30

TypeScript version

5.5.2

System Info

System:
    OS: macOS 14.5
    CPU: (8) arm64 Apple M1 Pro
    Memory: 57.80 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.3.0 - ~/Code/data-visualization/packages/rds/node_modules/.bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 10.8.1 - ~/.nvm/versions/node/v22.3.0/bin/npm
    pnpm: 9.4.0 - ~/.nvm/versions/node/v22.3.0/bin/pnpm
    bun: 1.1.15 - /opt/homebrew/bin/bun
  Browsers:
    Chrome: 126.0.6478.63
    Safari: 17.5

Steps to reproduce

  1. pnpm create vite@latest -> Vue project with TS
  2. pnpm update
  3. vue-tsc --declaration --emitDeclarationOnly -p tsconfig.app.json

Throws:
Error: VirtualCode id must be lowercase: scriptSetupFormat

@davidmatter davidmatter added pending triage bug Something isn't working and removed pending triage labels Jun 24, 2024
@davidmatter
Copy link
Collaborator Author

Regression from volarjs/volar.js@1f6e2bf

@chaozwn

This comment was marked as duplicate.

@lancewilhelm
Copy link

lancewilhelm commented Jun 24, 2024

Same error as @chaozwn also on neovim, mac M2 (and I believe my Ubuntu (noble) machine suffered the same error). vue-language-server version 2.0.22.

I have tried different node LTS versions as well as the latest with no success. Tried creating a new Vue project with npm create vue@latest with the hope that my project with the issue, but same error on a fresh project (default options, 'no' to everything).

Edit:
Just tried rolling back incrementally from 2.0.22, and found that 2.0.19 is working for me, but I experience the same error from 2.0.20 onward. The error that @chaozwn experienced is also accompanied by a typescript server error that is first thrown to screen as I configure the tsserver LS in neovim to use the @vue/typescript-plugin.

tsserver: 1: TypeScript Server Error (5.5.2)
Cannot read properties of undefined (reading 'getSourceFile')
TypeError: Cannot read properties of undefined (reading 'getSourceFile')
at /Users/lancewilhelm/Projects/qua/node_modules/typescript/lib/typescript.js:149234:82
at mapDefined (/Users/lancewilhelm/Projects/qua/node_modules/typescript/lib/typescript.js:2699:22)
at getDocumentHighlights (/Users/lancewilhelm/Projects/qua/node_modules/typescript/lib/typescript.js:149234:33)
at /Users/lancewilhelm/.local/share/nvim/mason/packages/vue-language-server/node_modules/@vue/language-server/node_modules/@volar/typescript/lib/node/decorateLanguageService.js:299:13
2
at process (/Users/lancewilhelm/.local/share/nvim/mason/packages/vue-language-server/node_modules/@vue/language-server/node_modules/@volar/typescript/lib/node/decorateLanguageService.
js:757:28)
at linkedCodeFeatureWorker (/Users/lancewilhelm/.local/share/nvim/mason/packages/vue-language-server/node_modules/@vue/language-server/node_modules/@volar/typescript/lib/node/decorate
LanguageService.js:749:13)
at languageService.getDocumentHighlights (/Users/lancewilhelm/.local/share/nvim/mason/packages/vue-language-server/node_modules/@vue/language-server/node_modules/@volar/typescript/lib
/node/decorateLanguageService.js:299:28)
at IpcIOSession.getDocumentHighlights (/Users/lancewilhelm/Projects/qua/node_modules/typescript/lib/typescript.js:190174:61)
at documentHighlights (/Users/lancewilhelm/Projects/qua/node_modules/typescript/lib/typescript.js:189140:43)
at /Users/lancewilhelm/Projects/qua/node_modules/typescript/lib/typescript.js:191397:69
at IpcIOSession.executeWithRequestId (/Users/lancewilhelm/Projects/qua/node_modules/typescript/lib/typescript.js:191389:14)
at IpcIOSession.executeCommand (/Users/lancewilhelm/Projects/qua/node_modules/typescript/lib/typescript.js:191397:29)
at IpcIOSession.onMessage (/Users/lancewilhelm/Projects/qua/node_modules/typescript/lib/typescript.js:191439:51)
at process. (/Users/lancewilhelm/Projects/qua/node_modules/typescript/lib/tsserver.js:523:14)
at process.emit (node:events:515:28)
at emit (node:internal/child_process:951:14)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

@JianGuoHt

This comment was marked as duplicate.

@davidmatter
Copy link
Collaborator Author

davidmatter commented Jun 24, 2024

@lancewilhelm you're right. The issue is in a dependency that will be installed above 2.0.19. You might want to try using version 2.0.19 along typescript@^5.4.0

dragonish added a commit to dragonish/slender-manager that referenced this issue Jun 24, 2024
@gin-18
Copy link

gin-18 commented Jun 24, 2024

Same error as @lancewilhelm also on neovim, arch linux.

I got the error when I update vue-language-server from 2.0.21 to 2.0.22 with mason.

tsserver: 1: TypeScript Server Error (5.5.2)
Cannot read properties of undefined (reading 'getSourceFile')
TypeError: Cannot read properties of undefined (reading 'getSourceFile')
at /Users/lancewilhelm/Projects/qua/node_modules/typescript/lib/typescript.js:149234:82
at mapDefined (/Users/lancewilhelm/Projects/qua/node_modules/typescript/lib/typescript.js:2699:22)
at getDocumentHighlights (/Users/lancewilhelm/Projects/qua/node_modules/typescript/lib/typescript.js:149234:33)
at /Users/lancewilhelm/.local/share/nvim/mason/packages/vue-language-server/node_modules/@vue/language-server/node_modules/@volar/typescript/lib/node/decorateLanguageService.js:299:13
2
at process (/Users/lancewilhelm/.local/share/nvim/mason/packages/vue-language-server/node_modules/@vue/language-server/node_modules/@volar/typescript/lib/node/decorateLanguageService.
js:757:28)
at linkedCodeFeatureWorker (/Users/lancewilhelm/.local/share/nvim/mason/packages/vue-language-server/node_modules/@vue/language-server/node_modules/@volar/typescript/lib/node/decorate
LanguageService.js:749:13)
at languageService.getDocumentHighlights (/Users/lancewilhelm/.local/share/nvim/mason/packages/vue-language-server/node_modules/@vue/language-server/node_modules/@volar/typescript/lib
/node/decorateLanguageService.js:299:28)
at IpcIOSession.getDocumentHighlights (/Users/lancewilhelm/Projects/qua/node_modules/typescript/lib/typescript.js:190174:61)
at documentHighlights (/Users/lancewilhelm/Projects/qua/node_modules/typescript/lib/typescript.js:189140:43)
at /Users/lancewilhelm/Projects/qua/node_modules/typescript/lib/typescript.js:191397:69
at IpcIOSession.executeWithRequestId (/Users/lancewilhelm/Projects/qua/node_modules/typescript/lib/typescript.js:191389:14)
at IpcIOSession.executeCommand (/Users/lancewilhelm/Projects/qua/node_modules/typescript/lib/typescript.js:191397:29)
at IpcIOSession.onMessage (/Users/lancewilhelm/Projects/qua/node_modules/typescript/lib/typescript.js:191439:51)
at process. (/Users/lancewilhelm/Projects/qua/node_modules/typescript/lib/tsserver.js:523:14)
at process.emit (node:events:515:28)
at emit (node:internal/child_process:951:14)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

@davidmatter
Copy link
Collaborator Author

davidmatter commented Jun 24, 2024

Edit: Not needed anymore, just update your dependencies.

Workaround: Add the following to your package.json if you're using pnpm

"pnpm": {
  "overrides": {
    "@volar/typescript": "2.3.1",
    "@volar/language-core": "2.3.1"
  }
}

For NPM, Yarn etc. you'll find other solutions.

@johnsoncodehk
Copy link
Member

johnsoncodehk commented Jun 24, 2024

Thanks for the report! This should fixed in @volar/* v2.3.3.

larsrickert added a commit to SchwarzIT/onyx that referenced this issue Jun 24, 2024
closes #1393

Remove workaround from #1395 because Volar has released a fix in
vuejs/language-tools#4497.
I updates all dependencies to the latest version.
@yenche123
Copy link

Workaround: Add the following to your package.json if you're using pnpm

"pnpm": {
  "overrides": {
    "@volar/typescript": "2.3.1",
    "@volar/language-core": "2.3.1"
  }
}

For NPM, Yarn etc. you'll find other solutions.

And then run pnpm i

@davidmatter
Copy link
Collaborator Author

@yenche123 this is not needed anymore. Just update your dependencies :)

@fallenyep
Copy link

Edit: Not needed anymore, just update your dependencies.

Workaround: Add the following to your package.json if you're using pnpm

"pnpm": {
  "overrides": {
    "@volar/typescript": "2.3.1",
    "@volar/language-core": "2.3.1"
  }
}

For NPM, Yarn etc. you'll find other solutions.

what should be added if using npm?

@MukeZ
Copy link

MukeZ commented Jun 27, 2024

Edit: Not needed anymore, just update your dependencies.
Workaround: Add the following to your package.json if you're using pnpm

"pnpm": {
  "overrides": {
    "@volar/typescript": "2.3.1",
    "@volar/language-core": "2.3.1"
  }
}

For NPM, Yarn etc. you'll find other solutions.

what should be added if using npm?

 "overrides": {
    "@volar/typescript": "2.3.1",
    "@volar/language-core": "2.3.1"
  }

then run npm install

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

Successfully merging a pull request may close this issue.

9 participants