Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug creating react app #19103

Open
7 tasks done
yayidg22 opened this issue Dec 30, 2024 · 5 comments
Open
7 tasks done

bug creating react app #19103

yayidg22 opened this issue Dec 30, 2024 · 5 comments

Comments

@yayidg22
Copy link

Describe the bug

image

the problem is this is a react (javascript) app if i rename the src/main.jsx to src/main.tsx works

Reproduction

no one

Steps to reproduce

$ yarn create vite my-react-app --template react
$ cd my-react-app
$ yarn install
$ yarn run dev

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-12400F
    Memory: 14.52 GB / 31.82 GB
  Binaries:
    Node: 18.20.3 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - C:\Program Files\nodejs\yarn.CMD
    npm: 10.7.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.3.0 - C:\Program Files\nodejs\pnpm.CMD
    bun: 1.1.38 - ~\.bun\bin\bun.EXE
  Browsers:
    Chrome: 131.0.6778.205
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    @vitejs/plugin-react: ^4.3.4 => 4.3.4
    vite: ^6.0.5 => 6.0.6

Used Package Manager

yarn

Logs

No response

Validations

@nozomuikuta
Copy link
Contributor

If you want to scaffold a React application with TypeScript, you need to use react-ts template.
Run yarn create vite my-react-app --template react-ts instead.

@bluwy
Copy link
Member

bluwy commented Jan 2, 2025

I can't quite reproduce the issue. We're correctly using .jsx and .tsx for the react and react-ts templates respectively.

https://github.com/vitejs/vite/blob/a4922537a8d705da7769d30626a0d846511fc124/packages/create-vite/template-react/src/main.jsx

https://github.com/vitejs/vite/blob/a4922537a8d705da7769d30626a0d846511fc124/packages/create-vite/template-react-ts/src/main.tsx

Can you provide a repro with the project? @yayidg22

Copy link

github-actions bot commented Jan 2, 2025

Hello @yayidg22. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs reproduction will be closed if they have no activity within 3 days.

@yayidg22
Copy link
Author

yayidg22 commented Jan 2, 2025

Hello this is the StackBlitz

@bluwy
Copy link
Member

bluwy commented Jan 2, 2025

I don't see any issue in the repro. It's rendering fine and there's no errors in the console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants