{"id":15022,"library":"volar-service-typescript-twoslash-queries","title":"Volar TypeScript Twoslash Queries Service","description":"This package integrates TypeScript Twoslash query capabilities directly into Volar-powered language services, enhancing developer tooling within Vue and other Volar-supported environments. It allows for inline type information and error checking queries within code comments, similar to how TypeScript's own playground functions. As of version 0.0.70, it is still in a pre-1.0 stage, indicating potential API changes but is actively maintained as part of the Volar ecosystem. Its release cadence is typically tied to Volar's own development cycle, meaning updates often coincide with new Volar releases or when new Twoslash features need integration. Key differentiators include its seamless integration into Volar's Language Server Protocol, providing rich type feedback without needing external tools or complex build steps for ad-hoc type queries directly within your editor.","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-twoslash-queries","lang":"bash","label":"npm"},{"cmd":"yarn add volar-service-typescript-twoslash-queries","lang":"bash","label":"yarn"},{"cmd":"pnpm add volar-service-typescript-twoslash-queries","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for Volar's core language service functionality, which this package extends.","package":"@volar/language-service","optional":false}],"imports":[{"note":"For ESM environments, 'create' is a named export. Avoid default imports.","wrong":"import volarTwoslashService from 'volar-service-typescript-twoslash-queries';","symbol":"create","correct":"import { create } from 'volar-service-typescript-twoslash-queries';"},{"note":"For CommonJS environments, 'create' is available as a named property on the module export.","wrong":"const volarTwoslashService = require('volar-service-typescript-twoslash-queries');","symbol":"create","correct":"const { create } = require('volar-service-typescript-twoslash-queries');"}],"quickstart":{"code":"module.exports = {\n\tservices: [\n\t\trequire('volar-service-typescript-twoslash-queries').create(),\n\t],\n};","lang":"javascript","description":"Demonstrates how to integrate the Twoslash queries service into a Volar configuration file."},"warnings":[{"fix":"Pin exact package versions (e.g., '0.0.70') in your `package.json` and review release notes thoroughly for any updates before upgrading.","message":"This package is currently in a pre-1.0 version (0.0.70), indicating its API surface may not be stable and could introduce breaking changes in minor versions. Always pin exact versions or review release notes carefully.","severity":"gotcha","affected_versions":"<1.0.0"},{"fix":"Ensure the installed version of `volar-service-typescript-twoslash-queries` matches the recommended version for your `@volar/language-service` installation. Check the package's `peerDependencies` and Volar's documentation.","message":"Compatibility with Volar's core language service is crucial. Major updates to `@volar/language-service` (e.g., v2.x to v3.x) often require corresponding updates to `volar-service-typescript-twoslash-queries` due to potential API changes in the Volar ecosystem.","severity":"breaking","affected_versions":">=0.0.1"}],"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-twoslash-queries` or `yarn add volar-service-typescript-twoslash-queries` in your project.","cause":"The package is not installed or the `require()`/`import` path is incorrect.","error":"Cannot find module 'volar-service-typescript-twoslash-queries'"},{"fix":"For CommonJS, use `require('volar-service-typescript-twoslash-queries').create()`. For ESM, use `import { create } from 'volar-service-typescript-twoslash-queries';` and then call `create()`.","cause":"Attempting to call `create` incorrectly, potentially due to a mismatch between CommonJS and ESM module usage, or an incorrect import alias.","error":"TypeError: require(...).create is not a function"},{"fix":"Update `volar-service-typescript-twoslash-queries` to a version that specifically supports your `@volar/language-service` version. Consult the package's `peerDependencies` in `package.json`.","cause":"There is a version mismatch between this service package and your core `@volar/language-service` installation, leading to API incompatibility.","error":"Service 'typescript-twoslash-queries' is not compatible with Volar version X.Y.Z"}],"ecosystem":"npm"}