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

tsc --watch doesn't pick up on changes to --jsx #51829

Closed
DanielRosenwasser opened this issue Dec 9, 2022 · 2 comments
Closed

tsc --watch doesn't pick up on changes to --jsx #51829

DanielRosenwasser opened this issue Dec 9, 2022 · 2 comments
Assignees
Labels
Bug A bug in TypeScript

Comments

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Dec 9, 2022

// ./tsconfig.json
{
    "compilerOptions": {
        "target": "esnext",
        "module": "commonjs",
        "noEmit": true,
    }
}
// ./src/index.tsx
declare var Foo: any;
let x = <Foo></Foo>;
[4:24:35 PM] Starting compilation in watch mode...

src/index.tsx:3:9 - error TS17004: Cannot use JSX unless the '--jsx' flag is provided.

3 let x = <Foo></Foo>;
          ~~~~~

[4:24:37 PM] Found 1 error. Watching for file changes.

Now add "jsx": "react", to the tsconfig.json.

  {
      "compilerOptions": {
+         "jsx": "react",
          "target": "esnext",
          "module": "commonjs",
          "noEmit": true,
      }
  }

Expected: Error should be gone.
Actual: Error is still present.

@xgqfrms
Copy link

xgqfrms commented Oct 12, 2023

any update?

still error

#56076

@jakebailey
Copy link
Member

Hm, can you try the beta or nightly? I think this was fixed in #53403 and this issue is an accidental dupe of #53391.

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

No branches or pull requests

5 participants