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

deno compile error [ERR_TYPES_NOT_FOUND] #25823

Open
keelii opened this issue Sep 23, 2024 · 7 comments
Open

deno compile error [ERR_TYPES_NOT_FOUND] #25823

keelii opened this issue Sep 23, 2024 · 7 comments
Labels
compile related to the `deno compile` feature types Issues related to TypeScript types

Comments

@keelii
Copy link

keelii commented Sep 23, 2024

deno 2.0.0-rc.4 (release candidate, release, aarch64-apple-darwin)
v8 12.9.202.13-rusty
typescript 5.6.2

{
  "name": "test_deno",
  "version": "1.0.0",
  "main": "index.js",
  "description": "",
  "devDependencies": {
    "eslint-plugin-vue": "^9.28.0"
  }
}

import plugin from "eslint-plugin-vue";
➜  test_deno deno compile main.ts
error: Failed resolving types. [ERR_TYPES_NOT_FOUND] Could not find types for 'file:///Users/XXXX/test_deno/node_modules/eslint-plugin-vue/index.js' imported from 'file:///Users/zhouqili/test_deno/main.ts'
    at file:///Users/XXXX/test_deno/main.ts:1:20
@marvinhagemeister
Copy link
Contributor

Looking at the files published in the eslint-plugin-vue there are indeed no types inside it. The package only contains .js files. Maybe we can find a way to ignore imports from packages by default. Does running the compile command with --no-check work?

deno compile --no-check main.ts

@marvinhagemeister marvinhagemeister added compile related to the `deno compile` feature types Issues related to TypeScript types labels Sep 23, 2024
@mstubenschrott
Copy link

I have the same problem with the probe-image-size package (also just .js files inside). It also affects deno test and --no-check helps at least, but is not optimal.

@igorbrasileiro
Copy link

igorbrasileiro commented Oct 4, 2024

I'm facing this issue, but with deno check. The project uses remix + turbo(repo), and it's a monorepo.

the dropdown imports a file from another workspace.

error: Failed resolving types. [ERR_TYPES_NOT_FOUND] Could not find types for 'root-path/packages/ui/src/lib/utils.ts' imported from 'root-path/apps/../components/Dropdown.tsx'

@yazan-abdalrahman
Copy link
Contributor

yazan-abdalrahman commented Oct 9, 2024

@keelii @marvinhagemeister
I tried to reproduce it, but I got this outcome. If my steps of reproducing were correct, I believe it resolved.

Recording.2024-10-09.143629.mp4

@caroluchoa
Copy link

@keelii @marvinhagemeister I tried to reproduce it, but I got this outcome. If my steps of reproducing were correct, I believe it resolved.

Recording.2024-10-09.143629.mp4

Hi Yazan, do you think this also resolves the error mentioned by @igorbrasileiro about the turbo+remix monorepo, when running deno check?

@yazan-abdalrahman
Copy link
Contributor

and it's a monorepo.

Hi @caroluchoa , I don't think so; I need something reproducible for that issue to see if it works or not.

@silverbucket
Copy link

I'm running into this error as well.

error: Failed resolving types. [ERR_TYPES_NOT_FOUND] Could not find types for 'file:///path_to_project/node_modules/.deno/ajv-formats-draft2019@1.6.1/node_modules/ajv-formats-draft2019/index.js' imported from 'file:///path_to_project/packages/schemas/src/validator.ts'
  at file:///path_to_project/packages/schemas/src/validator.ts:5:34

That line (5):

import additionsFormats2019 from "ajv-formats-draft2019";

The package does not have typing:
https://www.npmjs.com/package/ajv-formats-draft2019

I remember this working when I was running deno ~1.45.x, I just upgraded to 2.0.2 and that's when I started getting this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compile related to the `deno compile` feature types Issues related to TypeScript types
Projects
None yet
Development

No branches or pull requests

7 participants