Skip to content

Compile error when trying to build typescript template #11080

Description

@fabioz

Versions:
Windows 10
create-react-app: 4.0.3

I haven't really done much.... I just did:

create-react-app my-app --template typescript

and then tried to yarn build and got an error (note: trying to yarn start was showing me the same error on the browser).

The error I have is:

> yarn build                                                                                                                                         
yarn run v1.21.1                                                                                                                                                   
$ react-scripts build                                                                                                                                              
Creating an optimized production build...                                                                                                                          
Failed to compile.                                                                                                                                                 
                                                                                                                                                                   
c:/temp/my-app/src/index.tsx 8:2                                                                           
Module parse failed: Unexpected token (8:2)                                                                                                                        
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders 
|                                                                                                                                                                  
| ReactDOM.render(                                                                                                                                                 
>   <React.StrictMode>                                                                                                                                             
|     <App />                                                                                                                                                      
|   </React.StrictMode>,                                                                                                                                           
                                                                                                                                                                   
                                                                                                                                                                   
error Command failed with exit code 1.                                                                                                                             
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.                                                                               ```

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions