Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Deno SDK doesn't fully understand the way of installing packages #24064

Open
FleetAdmiralJakob opened this issue Feb 1, 2025 · 5 comments

Comments

@FleetAdmiralJakob
Copy link

Summary

Steps to trigger the problem:

  1. Install a package with Deno e.g. (deno install npm:pdf.js-extract)
  2. Import this package in one of your files

Actual Behavior:

Image

The Deno SDK doesn't find the globally installed package

Expected Behavior:

No error since it is installed and works fine running `deno run dev``

deno.json:

{
  "tasks": {
    "dev": "deno run --watch --allow-read main.ts"
  },
  "imports": {
    "pdf.js-extract": "npm:pdf.js-extract@^0.2.1"
  }
}

Zed Version and System Specs

Zed: v0.171.5 (Zed)
OS: macOS 15.1.1
Memory: 8 GiB
Architecture: x86_64

@alienvspredator
Copy link

Seems like this issue is coming from the default TypeScript Language server.

https://zed.dev/docs/languages/deno

To use the Deno Language Server with TypeScript and TSX files, you will likely wish to to disable the default language servers and enable deno

@FleetAdmiralJakob
Copy link
Author

Ah ok, maybe that works. Can I do it on a per-project basis, because I have other non-Deno projects?

@alienvspredator
Copy link

Can I do it on a per-project basis

I think so, in the project settings: zed > Settings > Open Project Settings

@FleetAdmiralJakob
Copy link
Author

Ok, I will try and keep you updated

@FleetAdmiralJakob
Copy link
Author

FleetAdmiralJakob commented Feb 3, 2025

Awesome! Thank you! It works! The only problem left is that it's telling me that I haven't installed @types/node but I have:

deno: NPM package "@types/node" is not installed or doesn't exist.
Image

That's my deno.json

{
  "tasks": {
    "dev": "deno run --watch --allow-read --env-file --allow-env --allow-ffi --allow-sys --allow-net main.ts"
  },
  "imports": {
    "@openai/openai": "jsr:@openai/openai@^4.82.0",
    "@types/node": "npm:@types/node@^22.13.0",
    "pdf-img-convert": "npm:pdf-img-convert@^2.0.0",
    "sharp": "npm:sharp@^0.33.5",
    "zod": "npm:zod@^3.24.1"
  },
  "nodeModulesDir": "auto"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants