-
-
Notifications
You must be signed in to change notification settings - Fork 27k
create-react-app error: import type * as PrettyFormat from './types' #8714
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
SolutionSet Typescript version > 3.8.0 solved this error.It's a new syntax of Typescript: type-only-imports-and-export import type { SomeThing } from "./some-module.js"; Documentcreate-react-app.dev/docs/adding-typescript
Related QA in Stack Overflow: |
@ibarapascal I'm getting the same error on a fresh CRA install using the typescript template (I tried it twice). Curious why this issue is being closed, rather than updating the typescript version in CRA to prevent the error for others? Thanks |
How does this work, the latest stable release version of TypeScript is 3.7.5? |
Hey @ibarapascal why did you close this issue? I'm having the same problem and your fix: |
Only using this comand: yarn add typescript @types/node @types/react @types/react-dom @types/jest didn't resolve my issue. Is there anything we need to change in the package.json? |
@SarthakThakur0097 You can manually change the Typescript version in your |
Fix published in 25.2.1, sorry about the inconvenience. |
Great thanks that fixed it |
Describe the bug
create-react-app with typescript, yarn start failed
Did you try recovering your dependencies?
NaN
Which terms did you search for in User Guide?
NaN
Environment
NaN
Steps to reproduce
npx create-react-app my-app --template typescript cd my-app yarn start
Expected behavior
Start normally
Actual behavior
Reproduced by multiple participants.
Related PR:
It related to package
pretty-format
: pretty-format/src/index.tsFrom commit history, we can see there is a related Pull Request two days ago, which changed:
From
To
Guessing it's related
Related S.O. questions
The text was updated successfully, but these errors were encountered: