react-jsx does not work with Preact
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- javascript, typescript
- Domaine
- build-system, tooling
Piste de recherche
Commencez par reproduire l’échec avec les options tsconfig indiquées et un build microbundle, puis examinez comment microbundle transmet les paramètres JSX à TypeScript. L’issue est terminée lorsque react-jsx avec jsxImportSource défini sur preact ne déclenche plus les erreurs contradictoires jsxFactory ou fragment-factory.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Hi
Error
I've recently made the switch to microbundle for a project that uses Preact and TypeScript.
Following the docs, and me having the latest version of TypeScript, I put the following in my tsconfig:
{
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "preact",
//...
}
}
However when building with microbundle I get the following error:
rpt2: options error TS5089: Option 'jsxFactory' cannot be specified when option 'jsx' is 'react-jsx'.
This seems weird behaviour as I have not specified the jsxFactory.
Combined with this I also get an error about the 'jsxFragmentFactory' having to be provided to use JSX Fragments, but I presume that is due to the fact the the jsxFactory is somehow incorrect.
I tried hardcoding the values from the config in my script (without success) by doing the following
microbundle --jsx react-jsx --jsxImportSource preact
Possible solution
I've been able to get microbundle working if I switch back to the tsconfig for older versions of TypeScript, so I'll be opting into this behaviour for now. For reference this is what the old config is:
{
"compilerOptions": {
"jsx": "react",
"jsxFactory": "h",
"jsxFragmentFactory": "Fragment",
//...
}
}
- Langage dominant
- JavaScript
- Étoiles
- 8.1k
- Forks
- 358
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de developit/microbundle
-
CSS
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
developit/microbundle#1002 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
developit/microbundle#789 · 1 commentaire ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 55/100
developit/microbundle#1100 · 4 commentaires ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
developit/microbundle#1094 · 1 commentaire ·
-
Disable minification by default Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
developit/microbundle#1093 · 3 commentaires · 1 réaction ·
Toutes les issues de developit/microbundle
Issues similaires
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
Improve Title Support Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
georgestephanis/p2026#40 ·
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Margaret-Petersen/food-delivery-app-clone-react-native#1981 ·