Skip to content

NPM packages not getting type definitions from @types/* #28464

Closed
@ThatBlockyPenguin

Description

@ThatBlockyPenguin

Just ran into this issue myself, but for whatever reason, it isn't working for me... If it's of any help, the output of ctrl+shift+p Deno: Info is:

deno 2.2.2 (release, x86_64-pc-windows-msvc) | vscode_deno 3.43.4 | vscode 1.97.2

@ThatBlockyPenguin Can you open a new issue with a reproduction and more details about the problem?

Originally posted by @nathanwhit in #27569


I certainly can!
I'm reporting this issue from a different computer (with the same issue).

System info

deno 2.2.3 (release, x86_64-unknown-linux-gnu) | vscode_deno 3.43.5 | vscode 1.98.0

My specific Linux distro is Manjaro Linux.

Steps to Reproduce:

  1. Create a new file with the following contents (copied from original issue):
    import { useEffect } from "react";
    
    const foo: string = useEffect; // this assignment should report a type error, but doesn't
    console.log(foo);
    
  2. Run deno add npm:react.
  3. See that no type checking is present:
    Image
    Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions