HewloThere
Type resolution for modules imported with `npm:` specifier
moved from here: https://discord.com/channels/684898665143206084/684898665151594506/1292948811643224136
if i'm importing something from npm with an
npm:
specifier (i.e. npm:vite
), if it has type definitions that reference another npm package (i.e. esbuild
), is it a deno issue or a package issue if the types aren't resolved by deno (at least, the deno vscode extension)?
tried with both npm:vite@5.4.8
as well as npm:vite@6.0.0-beta.2
and both of them don't load the types of esbuild
when importing.
i don't have this issue when importing it from esm.sh, though. and if i manually add esbuild
to the imports
in my deno.json
, it works too. but not if i directly import from npm:vite
.
if this is to be expected then that's all good, just was wondering if i should report an issue or anything 🙂
actually, it correctly resolves the type (in the vscode extension?) up until i try to look at the types for vite.
not sure if it's just flaky, but it seems to only work (until i navigate to the types for vite) if i tell deno to generate a lock file and i have run deno clean? i think?
e.g.:
deno.json
:
file.ts
26 replies
deno gives 401 unauthorized for imports with an `npm:` specifier, but npm, yarn and pnpm all work?
heya!
i'm having difficulty with getting
npm:
specifiers to work. i've tried them via an import like below, or running via the cli. both give a 401 error for any package (regardless of if it's scoped, unscoped, using a specific npm config registry or anything).
i tried this in all of stable
, canary
and rc
deno versions - all have the same. i'll include debug logs from the latest rc
it used to work a few weeks ago, then it stopped working with all versions for a bit, then i created a new artifactory token and put that in my npmrc and it worked for a few days, and now it's back to not working again?
if it makes any difference, i'm using company vpn. and i had vscode closed and i was using a new terminal for this test, same result :/
both of these don't work and give this error:
i'll add debug logs and configs in the following messages25 replies