-
Notifications
You must be signed in to change notification settings - Fork 405
CRA4+TypeScript failure on jsx:preserve #826
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
Comments
Thanks for pointing it out, I'm sure that will help future users, probably the issue will be fixed on his side asap |
Update: This appears to be fixed in create-react-app/react-scripts 4.0.1. I have not tested exhaustively, but this worked in my testing:
Environment:
I tested this both in an existing app that I upgraded to React 17 + TypeScript 4 and also in a test app I just bootstrapped using latest 4.0.1 version of create-react-app and following LinguiJS documentation here: One thing I'd like to note from the docs on using LinguiJS with TypeScript documentation: I am still setting
There does not appear to be any way to prevent or override this behavior, but at the same time, I appear to be able to still utilize all LinguiJS functionality without setting Best regards, |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Describe the bug
Informational: This is not a LinguiJS bug, but does impact the ability to run Lingui when using Create React App 4 with TypeScript.
It appears that CRA4 currently fails if you set
"jsx": "preserve"
in yourtsconfig.json
file, which a Lingui requirement for preserving JSX and tagged template literals:https://lingui.js.org/guides/typescript.html
In create-react-app project refer to the following issues:
To Reproduce
npx create-react-app cra4 --template redux-typescript
Then modify
tsconfig.json
and change:run dev server with:
npm start
Results:
Expected behavior
Setting
jsx:preserve
fails to start a run server.Setting
jsx:react
(the default) starts a run server but Lingui is unable to extract message catalogs.Additional context
3.0.3
7.12.3
4.0.0
4.0.5
The text was updated successfully, but these errors were encountered: