# TS6142: Module '…' was resolved to '…', but '--jsx' is not set.

> A `.tsx` or `.jsx` module is imported but the `jsx` compiler option isn't set. Set `jsx` in tsconfig.json.

## What it means

An import resolved to a file that contains JSX, but the project has no `jsx` option, so it
doesn't know how to treat that file. It's reported on the import's module specifier. In
projects with many components this often appears together with [TS17004](https://ts-r.dev/errors/TS17004/).

## Example

```ts
import { Button } from "./button";
export const b = Button;
```

```tsx
export function Button() {
  return null;
}
```

## How to fix

- Set `"jsx"` in tsconfig.json: `"react-jsx"` for React 17 and later, `"preserve"` if another
  tool transforms JSX.

Source: https://ts-r.dev/errors/TS6142/
