{"id":12388,"library":"volar-service-typescript","title":"Volar TypeScript Language Service","description":"This package, `volar-service-typescript`, integrates TypeScript language services into Volar, a powerful language tooling framework primarily developed for Vue and other web technologies. Currently at version 0.0.70, it functions as a critical plugin within the Volar ecosystem, providing essential features such as accurate type checking, intelligent code completion, robust refactoring capabilities, and comprehensive error diagnostics specifically tailored for TypeScript files within projects utilizing Volar. As an official component of the broader Volar project, its release cadence is closely tied to Volar's own development cycle, which typically involves continuous integration with frequent updates and patch releases, often aligning with the evolution of TypeScript itself. Its key differentiator is its role as the official and most deeply integrated method for leveraging TypeScript's full capabilities directly within Volar-powered development environments, ensuring seamless functionality and optimized performance compared to more generic language server integrations or alternative solutions.","status":"active","version":"0.0.70","language":"javascript","source_language":"en","source_url":"https://github.com/volarjs/services","tags":["javascript","volar-service","typescript"],"install":[{"cmd":"npm install volar-service-typescript","lang":"bash","label":"npm"},{"cmd":"yarn add volar-service-typescript","lang":"bash","label":"yarn"},{"cmd":"pnpm add volar-service-typescript","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required peer dependency for Volar's core language service functionality, which this plugin extends.","package":"@volar/language-service","optional":false}],"imports":[{"note":"The primary export is a named `create` function for configuring the service. Most modern setups will use ESM imports.","wrong":"import create from 'volar-service-typescript';","symbol":"create","correct":"import { create } from 'volar-service-typescript';"},{"note":"When using CommonJS, particularly in configuration files like `volar.config.js`, the `create` function must be destructured from the module export.","wrong":"const create = require('volar-service-typescript');","symbol":"create","correct":"const { create } = require('volar-service-typescript');"}],"quickstart":{"code":"/* volar.config.js */\nmodule.exports = {\n\t// Other Volar configurations...\n\n\tservices: [\n\t\t// Integrate the TypeScript language service\n\t\trequire('volar-service-typescript').create({\n\t\t\t// Optional: Custom TypeScript plugin options\n\t\t\t// E.g., disable default semantic diagnostics if handled externally\n\t\t\t// diagnosticSemantic: false,\n\t\t}),\n\t],\n};\n\n/* Example tsconfig.json (in your project root) */\n{\n  \"compilerOptions\": {\n    \"target\": \"ESNext\",\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"Bundler\",\n    \"strict\": true,\n    \"jsx\": \"preserve\",\n    \"importHelpers\": true,\n    \"lib\": [\"ESNext\", \"DOM\", \"DOM.Iterable\"],\n    \"skipLibCheck\": true,\n    // ... other TS options\n  },\n  \"include\": [\"src/**/*.ts\", \"src/**/*.d.ts\", \"src/**/*.tsx\", \"src/**/*.vue\"]\n}","lang":"javascript","description":"This quickstart demonstrates how to configure `volar-service-typescript` within your `volar.config.js` to enable TypeScript language features in your Volar project, alongside a basic `tsconfig.json`."},"warnings":[{"fix":"Ensure `volar-service-typescript` is updated to a version compatible with your `@volar/language-service` installation. Refer to the official Volar documentation or GitHub releases for compatibility matrices.","message":"Major version updates of `@volar/language-service` often introduce breaking changes that require updating `volar-service-typescript` to a compatible version. Always check the Volar release notes.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Try to align your project's `typescript` dependency version with what Volar officially supports or recommends. If issues persist, consider using Volar's 'Use Workspace TypeScript Version' setting if available in your editor.","message":"TypeScript version mismatches between your project's `typescript` dependency and the version Volar or its services might be using can lead to unexpected type errors or incorrect diagnostics.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Consult the latest Volar documentation for the correct `volar.config.js` syntax and `volar-service-typescript.create()` options for your specific Volar version.","message":"Changes to the `volar.config.js` structure or the `create()` function's options between Volar versions can lead to service not loading or incorrect behavior.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Run `npm install volar-service-typescript` or `yarn add volar-service-typescript` to install the package.","cause":"The package `volar-service-typescript` is not installed in your project.","error":"Cannot find module 'volar-service-typescript'"},{"fix":"Ensure you are using named imports: `import { create } from 'volar-service-typescript';` for ESM, or correct destructuring for CJS: `const { create } = require('volar-service-typescript');`.","cause":"This error typically occurs in bundled environments (like Webpack) when attempting to default import a named CommonJS export, or incorrect destructuring.","error":"TypeError: (0 , volar_service_typescript__WEBPACK_IMPORTED_MODULE_0__.create) is not a function"},{"fix":"Install the peer dependency: `npm install @volar/language-service@~2.4.0` (adjust version to match your Volar installation's requirement).","cause":"Volar's core language service, a peer dependency, is missing from your project.","error":"The \"@volar/language-service\" peer dependency is not installed."}],"ecosystem":"npm"}