Bloxs
Bloxs
DDeno
Created by Bloxs on 6/1/2024 in #help
Deno LSP doesn't recognize workspaces as imports
For some reason the vscode plugin for deno says this code is invalid even though it runs perfectly fine via the cli. mod.ts:
import { add } from "@mypackage/test";

console.log(add(1, 2)); // 3
import { add } from "@mypackage/test";

console.log(add(1, 2)); // 3
deno.jsonc:
{
"name": "@mypackage/root",
"version": "0.0.1",
"workspaces": [
"./test"
]
}
{
"name": "@mypackage/root",
"version": "0.0.1",
"workspaces": [
"./test"
]
}
./test/mod.ts
export const add = (a: number, b: number) => a + b;
export const add = (a: number, b: number) => a + b;
./test/deno.jsonc
{
"name": "@mypackage/test",
"version": "0.0.1",
"exports": "./mod.ts"
}
{
"name": "@mypackage/test",
"version": "0.0.1",
"exports": "./mod.ts"
}
When I run mod.ts via the cli I get 3 which is expected but the vscode lsp says Relative import path "@mypackage/test" not prefixed with / or ./ or ../
4 replies