rally25rs
rally25rs
DDeno
Created by rally25rs on 10/11/2023 in #help
'Relative import path not prefixed' error from @types/express .d.ts file?
Converting an express mjs project to deno & TS, and running into an issue using code from this example: https://docs.deno.com/runtime/tutorials/how_to_with_npm/express Using
// @deno-types="npm:@types/express@4.17.15"
import express from "npm:express@4.18.2";
// @deno-types="npm:@types/express@4.17.15"
import express from "npm:express@4.18.2";
results in
Task start deno run --allow-read --allow-env --allow-net index.ts
error: Relative import path "qs" not prefixed with / or ./ or ../ and not in import map from "file:///Users/jeff/Library/Caches/deno/npm/registry.npmjs.org/@types/express/4.17.18/index.d.ts"
at file:///Users/jeff/Library/Caches/deno/npm/registry.npmjs.org/@types/express/4.17.18/index.d.ts:21:21
Task start deno run --allow-read --allow-env --allow-net index.ts
error: Relative import path "qs" not prefixed with / or ./ or ../ and not in import map from "file:///Users/jeff/Library/Caches/deno/npm/registry.npmjs.org/@types/express/4.17.18/index.d.ts"
at file:///Users/jeff/Library/Caches/deno/npm/registry.npmjs.org/@types/express/4.17.18/index.d.ts:21:21
Whats extra strange is that the error mentions @types/express/4.17.18 which isn't even the version in my code:
// @deno-types="npm:@types/express@4.17.15"
// @deno-types="npm:@types/express@4.17.15"
deno --version is:
deno 1.37.1 (release, x86_64-apple-darwin)
v8 11.8.172.6
typescript 5.2.2
deno 1.37.1 (release, x86_64-apple-darwin)
v8 11.8.172.6
typescript 5.2.2
Any suggestions on how to further debug this issue?
3 replies