Registry / web-framework / volar-service-typescript

volar-service-typescript

JSON →
library0.0.70jsnpmunverified

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.

npm install volar-service-typescript
INSTALL
IMPORT
SIG · VOLAR-SERVICE-TYPE
V
volar-service-typescript
web-frameworkjavascriptv0.0.70
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

create
✓ import { create } from 'volar-service-typescript';
✗ import create from 'volar-service-typescript';
The primary export is a named `create` function for configuring the service. Most modern setups will use ESM imports.
create
✓ const { create } = require('volar-service-typescript');
✗ const create = require('volar-service-typescript');
When using CommonJS, particularly in configuration files like `volar.config.js`, the `create` function must be destructured from the module export.

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`.

/* volar.config.js */ module.exports = { // Other Volar configurations... services: [ // Integrate the TypeScript language service require('volar-service-typescript').create({ // Optional: Custom TypeScript plugin options // E.g., disable default semantic diagnostics if handled externally // diagnosticSemantic: false, }), ], }; /* Example tsconfig.json (in your project root) */ { "compilerOptions": { "target": "ESNext", "module": "ESNext", "moduleResolution": "Bundler", "strict": true, "jsx": "preserve", "importHelpers": true, "lib": ["ESNext", "DOM", "DOM.Iterable"], "skipLibCheck": true, // ... other TS options }, "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"] }
Debug
Known issues
breakingMajor 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.
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.
affects: >=0.0.0
gotchaTypeScript 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.
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.
affects: >=0.0.0
gotchaChanges to the `volar.config.js` structure or the `create()` function's options between Volar versions can lead to service not loading or incorrect behavior.
fix
Consult the latest Volar documentation for the correct `volar.config.js` syntax and `volar-service-typescript.create()` options for your specific Volar version.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'volar-service-typescript'
The package `volar-service-typescript` is not installed in your project.
fix
Run `npm install volar-service-typescript` or `yarn add volar-service-typescript` to install the package.
TypeError: (0 , volar_service_typescript__WEBPACK_IMPORTED_MODULE_0__.create) is not a function
This error typically occurs in bundled environments (like Webpack) when attempting to default import a named CommonJS export, or incorrect destructuring.
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');`.
The "@volar/language-service" peer dependency is not installed.
Volar's core language service, a peer dependency, is missing from your project.
fix
Install the peer dependency: `npm install @volar/language-service@~2.4.0` (adjust version to match your Volar installation's requirement).
Upgrade
Version history
0.0.70latest on npm
Audit
Dependencies
@volar/language-servicerequiredRequired peer dependency for Volar's core language service functionality, which this plugin extends.
Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
volar-service-typescript — npm install volar-service-typescript · libregistry