'paths' disappeared in tsconfig when i run ‘npm start’
See original GitHub issueMy project is init based on create-react-app,and i install ‘typescript’ in my project, then edit the config of ‘tsconfig.json’:
"compilerOptions": {
"baseUrl": ".",
"paths": {
"components/*": [
"src/components/*"
]
}
},
when i run ‘npm start’, i got some problems, and one is, ‘paths’ disappeared。
i have got the correct solution,set ‘paths’ in a external files, then send this url to ‘extends’。
But, I am very confused, why did i have this problem????????
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Why is my Typescript "paths" setting getting removed when I ...
When I set it up, my files look fine and do not complain. However, when I run the project, the "paths" gets deleted...
Read more >tsconfig-paths - npm
Load node modules according to tsconfig paths, in run-time or via API. ... Start using tsconfig-paths in your project by running `npm i ......
Read more >Stop using Relative Paths — Use Import Aliases for ... - Medium
If we run tsc tsconfig.json in our build script, what we notice is that the paths are not mapped correctly in the output...
Read more >Migrating a Create React App project to Vite - Darek Kay
Run npm install or yarn . I recommend deleting node_modules beforehand. Replace scripts in package.json (I'll cover test later):.
Read more >Creating a React app with TypeScript and ESLint with ...
We are also telling Webpack to open the browser after the server has been started. Adding an npm script to run the app...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@camillalo CRA allows using absolute paths out of the box. Even though you’ll be only able to use actual folder names, it does the job well. The docs: https://create-react-app.dev/docs/importing-a-component/#absolute-imports
Getting the same issue when trying to add
"paths" : { ... }
to my tsconfig.json.