Giter Site home page Giter Site logo

Cannot find name react. about typescript HOT 10 CLOSED

mrVin99 avatar mrVin99 commented on June 27, 2024
Cannot find name react.

from typescript.

Comments (10)

RyanCavanaugh avatar RyanCavanaugh commented on June 27, 2024 1

This is a misconfiguration. TypeScript won't automatically pick up two files with the same extension via include (this is intentional), so index.ts is part of your project and index.tsx isn't (thus index.tsx is in the inferred project which doesn't have any of the necessary jsx settings). You'll need to put index.tsx in the files array or otherwise modify your config if you want to do this.

from typescript.

mrVin99 avatar mrVin99 commented on June 27, 2024

I figured out.
VSCode is unable to differentiate between index.ts and index.tsx. Changing index.ts to anything else made the problem go away.
Gonna leave this issue open because imo this is a bug.

from typescript.

iisaduan avatar iisaduan commented on June 27, 2024

Can you provide sample code/repro steps to help us investigate?

from typescript.

RyanCavanaugh avatar RyanCavanaugh commented on June 27, 2024

It looks like this is a question rather than a bug report. This issue tracker is for tracking bugs and active work on TypeScript itself, rather than a general forum for programmers using TypeScript to get help or ask questions.

You can ask questions on sites like Stack Overflow. We are not able to provide one-on-one support on the issue tracker. Please read the issue template carefully - it has important information on what kinds of reports can be acted on here, as well as links to useful TypeScript resources. Thanks!

from typescript.

mrVin99 avatar mrVin99 commented on June 27, 2024

It looks like this is a question rather than a bug report. This issue tracker is for tracking bugs and active work on TypeScript itself, rather than a general forum for programmers using TypeScript to get help or ask questions.

You can ask questions on sites like Stack Overflow. We are not able to provide one-on-one support on the issue tracker. Please read the issue template carefully - it has important information on what kinds of reports can be acted on here, as well as links to useful TypeScript resources. Thanks!

Respectfully i disagree, this is not a question, this is a issue. I'll provide an sample repository.

from typescript.

fatcerberus avatar fatcerberus commented on June 27, 2024

If it’s a bug, you need to use the bug report template.

from typescript.

mrVin99 avatar mrVin99 commented on June 27, 2024

@fatcerberus
@iisaduan
@RyanCavanaugh

Here:

https://github.com/mrVin99/vscode-issue-58844

Unless somehow its a problem within my vscode setup, you should be able to see. Install the dependencies (pnpm or npm) and just go to index.tsx, it should display the error msg. Change the index.ts to anything you want .ts, the error msg will dissapear.

image

from typescript.

mrVin99 avatar mrVin99 commented on June 27, 2024

@fatcerberus @iisaduan @RyanCavanaugh

Here:

https://github.com/mrVin99/vscode-issue-58844

Unless somehow its a problem within my vscode setup, you should be able to see. Install the dependencies (pnpm or npm) and just go to index.tsx, it should display the error msg. Change the index.ts to anything you want .ts, the error msg will dissapear.

image

For reference, this is not a problem with intellij idea. So for this reason i believe this to be a bug.

image

from typescript.

mrVin99 avatar mrVin99 commented on June 27, 2024

If it’s a bug, you need to use the bug report template.

Sorry about, should i create a new issue report or is the repository and explanation above good enough?

from typescript.

mrVin99 avatar mrVin99 commented on June 27, 2024

Didn't know it was intentional, since it worked on intellij. I'll look this up, thanks for the help!

from typescript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.