deno icon indicating copy to clipboard operation
deno copied to clipboard

deno compile error [ERR_TYPES_NOT_FOUND]

Open keelii opened this issue 1 year ago • 7 comments

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

keelii avatar Sep 23 '24 08:09 keelii

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 avatar Sep 23 '24 08:09 marvinhagemeister

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.

mstubenschrott avatar Sep 30 '24 15:09 mstubenschrott

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'

igorbrasileiro avatar Oct 04 '24 15:10 igorbrasileiro

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

https://github.com/user-attachments/assets/7fb0ae9d-b62c-400c-b5c1-75eade92d6e2

yazan-abdalrahman avatar Oct 09 '24 11:10 yazan-abdalrahman

@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?

caroluchoa avatar Oct 15 '24 13:10 caroluchoa

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.

yazan-abdalrahman avatar Oct 15 '24 13:10 yazan-abdalrahman

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/[email protected]/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.

silverbucket avatar Oct 22 '24 22:10 silverbucket

This is fixed as of 2.1.9 for eslint-plugin-vue. Please open specific issues for specific packages/problems if this is still occurring for a package.

dsherret avatar Feb 03 '25 16:02 dsherret