diff --git a/typescript/vscode-ext/packages/language-server/src/server.ts b/typescript/vscode-ext/packages/language-server/src/server.ts index 801e939e0..e7a0745bb 100644 --- a/typescript/vscode-ext/packages/language-server/src/server.ts +++ b/typescript/vscode-ext/packages/language-server/src/server.ts @@ -38,6 +38,13 @@ import { z } from 'zod' import BamlProjectManager from './lib/baml_project_manager' import type { LSOptions, LSSettings } from './lib/types' +try { + // only required on vscode versions 1.89 and below. + ;(globalThis as any).crypto = require('node:crypto').webcrypto +} catch (e) { + console.log('cant load webcrypto', e) +} + const packageJson = require('../../package.json') // eslint-disable-line function getConnection(options?: LSOptions): Connection { let connection = options?.connection diff --git a/typescript/vscode-ext/packages/package.json b/typescript/vscode-ext/packages/package.json index 1d588a529..027006e06 100644 --- a/typescript/vscode-ext/packages/package.json +++ b/typescript/vscode-ext/packages/package.json @@ -2,7 +2,7 @@ "name": "baml-extension", "displayName": "Baml", "description": "BAML is a DSL for AI applications.", - "version": "0.39.0", + "version": "0.39.1", "publisher": "Boundary", "repository": "https://github.com/BoundaryML/baml", "homepage": "https://www.boundaryml.com",