typescript didn't enabled for a fresh CRA app
Created by: j0053f
I have a CRA app. I want to start using typescript. according to this guide for adding typescript to an existing Create React App project I installed the typescript and required type definitions:
npm install --save typescript @types/node @types/react @types/react-dom @types/jest
and add a file named test.tsx
contains:
export default function Test(){
return (
<div>this is test to see typescirpt</div>
)
}
and import and use it in main.js
ctrl+c
previous development server.
and did npm start
.
I'm getting bellow error.
Failed to compile.
Module not found: Error: Can't resolve './test' in '/home/g/w/projects/movie_watch_list_frontend/src'
ERROR in ./src/App.js 15:0-26
Module not found: Error: Can't resolve './test' in '/home/g/w/projects/movie_watch_list_frontend/src'
webpack compiled with 1 error
also, there isn't any auto-created tsconfig
file in the project folder.
I pushed the change that I made in a new branch named typescript to my reposity
also, I repeat this process for a fresh CRA app, and the same error happened.
am I doing something wrong?
Originally posted by @j0053f in https://github.com/facebook/create-react-app/discussions/12295