Stop putting react-app-env.d.ts in src
(This pertains to CRA w/ the `--typescript flag`.) Putting a loose d.ts file at the top level of src adds clutter and breaks the convention of putting all d.ts files together in a folder, such as "types". Suggestions to remedy this (in order of preference): 1. Honor the new location of react-app-env.d.ts if we move it. 2. Allow us to configure where this file goes. 3. Place the file in src/types. --------- EDIT: @nhooyr Given its confusing, you could also add a comment to the generated file explaining why its there. @bugzpodder This file was created to include create-react-app specific types. Removing it will cause errors like: ``` TypeScript error in ~/src/App.tsx(2,18): Cannot find module './logo.svg'. TS2307 1 | import React from 'react'; > 2 | import logo from './logo.svg'; | ^ 3 | import './App.css'; 4 | 5 | const App: React.FC = () => { ``` This was created from #5611 if you want more details.
Posted by devuxer on Mar 2, 2019, 11:49 PM
Tags
Related issues
- 2026 - Microsoft Office 365
- [Ubuntu] `ubuntu-latest` label will use Ubuntu 26.04 in November 2026
- Gamut mapping
- [Codex Desktop] Editing and resending a queued message triggers "App-server queued follow-up no longer exists"
- [Windows] ChatGPT 26.820.60940 fails with "invalid transport in mcp_servers.codex_app"; Beta 26.727.40816 works
- [BUG]: infinite loading of videos
Raise real-world problems, find people facing the same issue, and discuss solutions.4,000 issues0 comments
github (SaaS)
2026 - Microsoft Office 365
[Ubuntu] `ubuntu-latest` label will use Ubuntu 26.04 in November 2026
Gamut mapping
[Codex Desktop] Editing and resending a queued message triggers "App-server queued follow-up no longer exists"
[Windows] ChatGPT 26.820.60940 fails with "invalid transport in mcp_servers.codex_app"; Beta 26.727.40816 works
[BUG]: infinite loading of videos
Restore GPT-5.6 Sol’s 372k Codex context window, or provide an opt-in setting
Codex Desktop for macOS repeatedly triggers `syspolicyd` / `trustd` CPU and memory runaway
Stop putting react-app-env.d.ts in src
(This pertains to CRA w/ the `--typescript flag`.) Putting a loose d.ts file at the top level of src adds clutter and breaks the convention of putting all d.ts files together in a folder, such as "types". Suggestions to remedy this (in order of preference): 1. Honor the new location of react-app-env.d.ts if we move it. 2. Allow us to configure where this file goes. 3. Place the file in src/types. --------- EDIT: @nhooyr Given its confusing, you could also add a comment to the generated file explaining why its there. @bugzpodder This file was created to include create-react-app specific types. Removing it will cause errors like: ``` TypeScript error in ~/src/App.tsx(2,18): Cannot find module './logo.svg'. TS2307 1 | import React from 'react'; > 2 | import logo from './logo.svg'; | ^ 3 | import './App.css'; 4 | 5 | const App: React.FC = () => { ``` This was created from #5611 if you want more details.
Comments (0)
No comments yet. Start the discussion.