Skip to content

TypeScript VS code extension does not work properly for API routes #77199

@jakeleventhal

Description

@jakeleventhal

Link to the code that reproduces this issue

https://github.com/jakeleventhal/next-types-issue

To Reproduce

Open app/page.tsx and app/api/route.ts and observe no type errors in route.ts in your IDE.

Image

Current vs. Expected behavior

I expected the revalidate export to show a type error in both app/page.tsx and app/api/route.ts, but only the page.tsx shows an error.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.4.0: Tue Mar  4 21:05:34 PST 2025; root:xnu-11417.100.576.505.3~2/RELEASE_ARM64_T6000
  Available memory (MB): 65536
  Available CPU cores: 10
Binaries:
  Node: 20.18.1
  npm: 10.8.2
  Yarn: 1.22.22
  pnpm: 9.15.9
Relevant Packages:
  next: 15.3.0-canary.10 // Latest available version is detected (15.3.0-canary.10).
  eslint-config-next: N/A
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.8.2
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

TypeScript

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    TypeScriptRelated to types with Next.js.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions