Create react app typscript does not load d.ts file
See original GitHub issueIs this a bug report?
No
Did you try recovering your dependencies?
YES
(Write your answer here.) npm --version 6.8.0
Which terms did you search for in User Guide?
(Write your answer here if relevant.)
Environment
Ubuntu
System: OS: Linux 4.4 Ubuntu 16.04.5 LTS (Xenial Xerus) CPU: x64 Intel® Core™ i5-5300U CPU @ 2.30GHz Binaries: Node: 10.0.0 - /usr/local/bin/node npm: 6.8.0 - /usr/local/bin/npm Browsers: Chrome: 72.0.3626.109 Firefox: 65.0 npmPackages: react: ^16.8.3 => 16.8.3 react-dom: ^16.8.3 => 16.8.3 react-scripts: 2.1.5 => 2.1.5 npmGlobalPackages: create-react-app: Not Found
Steps to Reproduce
(Write your steps here:)
I have moved my project into create react app typeascript from a webpack based build structure. It contains all the d.ts files in one folder. When i start my script server . it shows all the declaration in d.ts as ‘X’ interface not found’. Following in my tsconfig file. I am not sure what i am i missing here. { “compilerOptions”: { “target”: “es6”, “lib”: [ “dom”, “es2017” ], “allowJs”: true, “skipLibCheck”: false, “esModuleInterop”: true, “allowSyntheticDefaultImports”: true, “strict”: false, “sourceMap”: true, “forceConsistentCasingInFileNames”: true, “module”: “esnext”, “moduleResolution”: “node”, “resolveJsonModule”: true, “isolatedModules”: true, “noEmit”: true, “jsx”: “preserve”, “pretty”: true, “preserveConstEnums”: true, “typeRoots”: [ “./node_modules/@types”, “src/types/" ] }, “include”: [ "src/” ] }
Expected Behavior
d.ts file should be auto detected by typescript and the definations be aviable to use globally
Actual Behavior
All the declaration in the d.ts files are missing
Reproducible Demo
(Paste the link to an example project and exact instructions to reproduce the issue.)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5
Top GitHub Comments
Hi ,
I had to mention “src/types/**/*”, specially in my includes in tsconfig.json file and then it was able to detect the d.ts file on its own.
This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.