-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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>
* 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.
see: facebook/create-react-app#13080 (comment) This commit adds 'node_modules/@jest/expect' along with numerous other Jest dependencies to the package-lock.json file. These updates will aid in ensuring the proper versions of packages are installed during the setup of the project, providing a more robust development and testing environment.
react-scripts error with typescript > 5, show more facebook/create-react-app#13080
react-scripts error with typescript > 5, show more facebook/create-react-app#13080
Updating this issue in hopes of finding a solution. The override workaround isn't suitable for a production project. |
...seriously? CRA has been dead in the water for about two years now, including security updates. The solution is to switch to vite or another bundler that has active support and maintenance. The override workaround is almost certainly the best you are going to get in the meantime. |
react-scripts error with typescript > 5, show more facebook/create-react-app#13080
Thank you @leviathanbadger ! Was an inspiration to switch to vite and, despite eject and custom webpack-config, it was much easier to switch to vite than I thought. I'm much happier now. Now that I've switched manually, I also found this migration tool from Create-React-App to vite, but haven't tested it: https://github.com/bhbs/viject |
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: