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

Typescript compilerOptions.types doesn't apply types #1425

Open
1 task done
tom-sherman opened this issue Apr 26, 2024 · 1 comment
Open
1 task done

Typescript compilerOptions.types doesn't apply types #1425

tom-sherman opened this issue Apr 26, 2024 · 1 comment

Comments

@tom-sherman
Copy link

tom-sherman commented Apr 26, 2024

Describe the bug

I can't reference a different typescript declaration when it exists in node_modules.

Link to the blitz that caused the error

https://stackblitz.com/edit/vitejs-vite-ymbqrc?file=src%2FApp.tsx

Steps to reproduce

  1. Spin up a new typescript + react project
  2. Update to latest canary
  3. Add "types": ["react/canary"] to compilerOptions in tsconfig.json
  4. Try to access a API that exists only in React canary and not stable

Expected behavior

react/canary.d.ts should be applied

Parity with Local

Screenshots

image

Platform

Browser name  = Chrome
Full version  = 124.0.0.0
Major version = 124
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
performance.memory = {
  "totalJSHeapSize": 116357453,
  "usedJSHeapSize": 93883557,
  "jsHeapSizeLimit": 4294705152
}
Hash = 41fbae16

Additional context

No response

@tom-sherman
Copy link
Author

/// <reference types="react/canary" />

Works as a workaround

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

1 participant