-
-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
(react-scripts) Support for TypeScript 5.x #13080
Comments
Same here, think it needs a minor update to accept typescript 5 . ( released a week ago ) |
WorkaroundCRA seems to work fine with TypeScript 5. So, if you need a temporary workaround for the error and happy to continue working with it, you can achieve that by creating a new Example: |
Trying the workaround from @Meligy on a small application (but with 5.0.3 instead of 5.0.2) has the following results:
I am going to test this on a more substantial application as well. |
Experiencing both issues ( The TypeError doesn't keep For me, the mentioned work around only suppresses the error when running |
I solved the |
+1 to @KurtGokhan's "overrides": {
"@typescript-eslint/typescript-estree": "^5.57.1",
"fork-ts-checker-webpack-plugin": "^6.5.3",
"typescript": "^5.0.3",
}, |
I was startled to find a subsequent result after my previous use of @Meligy suggestion. Removing the override failed with react 5.0.2, but succeeded with react 5.0.3! What the heck? The dependency declarations for react-scripts 5.0.1 did not change, but the resulting behavior certainly did. Without any actual release notes for 5.0.3, it is not at all clear what actually changed that might have caused this. EDIT: Never mind. Deleting node_modules and reinstalling everything (without the overrides entry) caused the error to reappear. Probably something to do with caching in my IDE. |
Is there some patch coming to fix this? I updated typescript to v5 and now react-scripts is failing, and we won't put an overrides on our project, that's a workaround not a fix |
This worked for me:
|
Just bringing this PR to attention to hopefully bump it's visibility and get it approved. This should resolve the issue going forward: #13071 |
I just used this override in ...
"fork-ts-checker-webpack-plugin": "^6.5.3",
...
"typescript": "^5.0.4"
},
"overrides": {
"react-scripts": {
"typescript": "^5"
}
}, |
Yes , its still an active issue , for me solved removing typescript , running npm i and then install again typescript... |
* typescript v5 is not currently supported by react-scripts (see facebook/create-react-app#13080)
until create-react-app bumps their version, see: facebook/create-react-app#13080
* chore(deps): bump axios from 0.24.0 to 1.3.6 * chore(deps): bump eslint from 7.32.0 to 8.39.0 - eslint from 7.32.0 to 8.39.0 - @typescript-eslint/eslint-plugin from 4.33.0 to 5.59.1 - @typescript-eslint/parser from 4.33.0 to 5.59.1 - eslint-plugin-parser from 4.0.0 to 4.2.1 - eslint-config-parser from 8.3.0 to 8.8.1 - correct assignment of license attributes in <meta> * chore(deps): bump i18next and react-i18next - i18next from 22.4.13 to 22.4.15 - react-i18next from 12.2.0 to 12.2.2 * chore(deps): bump ts-node from 10.3.0 to 10.9.1 * chore(deps): bump ts-prune from 0.10.1 to 0.10.3 * chore(deps): bump underscore from 1.13.1 to 1.13.6 * chore(deps): bump rimraf from 3.0.2 to 5.0.0 * chore(deps): bump @types/underscore from 1.11.3 to 1.11.4 * chore(deps): bump react-collapsible from 2.8.4 to 2.8.10 * chore(deps): bump prettier from 2.4.1 to 2.8.8 - add parentheses for `TypeofTypeAnnotation` (prettier/prettier#14458, prettier/prettier#14042) * chore(deps): bump mkdirp from 1.0.4 to 3.0.1 * chore(deps): bump react-to-print from 2.14.0 to 2.14.12 * chore(deps): bump react-icons from 4.3.1 to 4.8.0 * chore(deps): bump gh-pages from 3.2.3 to 4.0.0 note: latest is 5.0.0, but it requires Node>=14 * chore(deps): bump typescript from 4.4.3 to 4.9.5* * typescript v5 is not currently supported by react-scripts (see facebook/create-react-app#13080) * chore(deps): bump google-spreadsheet from 3.1.15 to 3.3.0 * chore(deps): bump depcheck from 1.4.2 to 1.4.3 --------- Co-authored-by: Federico Grandi <fgrandi30@gmail.com>
Currently using this workaround, but I just hope this issue will get solved one day - as it really is not a fix, and consists of risks for projects requiring high stabilities of dependencies. |
It is extremely unlikely that this will ever get officially "fixed". Create React App is basically dead. Nothing has been updated for over two years now. Even the documentation about it has been migrated to a "legacy" URL: https://legacy.reactjs.org/docs/create-a-new-react-app.html The React team recommends using a different toolchain, including (for example) Next.js that has implementation support for React Server Components and Server Actions. |
Looking for an update as well. Sadly, CRA is still widely used and the migration is unjustifiable right now. |
… with TypeScript 5. Ref facebook/create-react-app#13080
* Remove web vitals check * Add github workflows file for unit test * Add babel dev dependencies to resolve the warning * update node packages * Add tsconfig file * Add eslintignore file * Import necessary packages for converting javascript to typescript * Convert to typescript files * Add overrides to resolve typescript 5.x version based on facebook/create-react-app#13080 * Sync the package lock file with "npm config set legacy-peer-deps false" and "npm i"
* update deps from dependabot alerts * workaround until react-scripts supports TypeScript 5.X facebook/create-react-app#13080
This patch adds the "overrides" section in package.json as a workaround for a TypeScript dependency conflict. For more info, check facebook/create-react-app#13080 It also removes the style-components dependecy, as it's likely to remain unused in this project.
Describe the bug
After
npx create-react-app frontend --template typescript
, when you update package.json to use"typescript": "^5.0.2",
,npm install <any package>
fails with this error:Did you try recovering your dependencies?
Default installation with the only change being typescript version in
package.json
Which terms did you search for in User Guide?
typescript
Environment
Environment Info:
current version of create-react-app: 5.0.1
running from /home/juha/.npm/_npx/c67e74de0542c87c/node_modules/create-react-app
System:
OS: Linux 4.15 Ubuntu 18.04.5 LTS (Bionic Beaver)
CPU: (1) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
Binaries:
Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node
Yarn: Not Found
npm: 8.11.0 - ~/.nvm/versions/node/v16.15.1/bin/npm
Browsers:
Chrome: Not Found
Firefox: 105.0
npmPackages:
react: ^18.2.0 => 18.2.0
react-dom: ^18.2.0 => 18.2.0
react-scripts: 5.0.1 => 5.0.1
npmGlobalPackages:
create-react-app: Not Found
Steps to reproduce
npx create-react-app frontend --template typescript
typescript: "^5.0.2"
npm install <some package>
Expected behavior
npm install
would run successfully.Actual behavior
Reproducible demo
Default CRA using
npx create-react-app frontend --template typescript
modify
package.json
to have"typescript": "^5.0.2"
run
npm install <any package>
The text was updated successfully, but these errors were encountered: