Updated react-scripts from 3 to 4.0.1 with all underlying packages (react#17, typescript#4.1 and eslint#7.14), now it shows Failed to compile. in the console with tons of prettier problems like they are errors. Used to run fine before, showing only Eslint warnings. Also if I hit save on any clean file under watch it recompiles fine (but again, used to show Eslint warning, which I would like to see there). Went through their docs and didn't find a way to configure this behavior, can it be?
Related
I'm getting this warning when I run my Turborepo project. My current turbo version is 1.7.0.
I get this warning at every initial start of my app using yarn dev. Once the app is running I do not get any issues or warnings after that.
The warning looks like this:
failed to contact turbod. Continuing in standalone mode: connection to turbo daemon process failed. Please ensure the following:
You can check the image below.
I tried removing node_modules and caches. But nothing fixes it.
I fixed the issue by deleting the turbod folder under .../Temp, remove node_modules, remove npm cache, and installing
I have a React 17 / Typescript 4.5 project. package.json looks like this:
...
"scripts": {
"start": "react-scripts start",
"build": "yarn run tsc --build"
}
My code has some Typescript errors that don't cause issues at runtime. When I run react-scripts start, the code builds and runs successfully in the browser, and React turns the errors into warnings that show up on initial page load. Conversely, when I run yarn run tsc --build, I can't compile the project due to the errors.
Yes, of course I should fix the errors, and I will. But while my code is rapidly evolving, solving certain tricky Typescript problems is premature. It may be useful to compile the code and temporarily ignore the errors.
I realize I can turn off specific errors in tsconfig.json, but I'd like to temporarily ignore all errors (at least, ones where Javascript can still be emitted).
Basically, what I want is a tsc flag that turns errors into warnings, but according to this related question, that doesn't exist. So how does react-scripts manage this? How can I compile my project in spite of the errors?
react-scripts uses a webpack plugin called ForkTsCheckerWebpackPlugin (see this line), which runs TypeScript type checking in a separate process and isn't actually used to transform your code from TypeScript to JavaScript before you run it. Instead, it looks like create-react-app uses #babel/preset-typescript (see this line), which doesn't perform any type checking but rather transpiles your code from TypeScript to JavaScript, so that's why your code is still able to run with TypeScript errors since Babel doesn't actually do any type checking with your code.
I'm currently working on a React project, initiated with Create React App. Currently, to compile, I am using the default command npm run start which runs react-scripts start.
I have a bunch of #typescript-eslint rules that force me to have a clean code before delivering it and deploy it. However, while I'm developing, I may have some unused variables and still want to compile to see if something else works.
Is there a command to force the compilation, while ignoring some or all #typescript-eslint rules?
This is a CRA configuration that can be overwritten. In an .env file, you can add these variables
TSC_COMPILE_ON_ERROR=true
ESLINT_NO_DEV_ERRORS=true
Here is the full list https://create-react-app.dev/docs/advanced-configuration/
all of sudden, I encountered something I cannot handle
when I do "create-react-app" and want to compile something,
it takes too.... much time to compile
most weirdly, it is only occurred when I change "components"
like typing "too slow " and after save it,
compiling takes too much time.
changing css is not the case of it. it is immediately complied and applied
only components changing has problem of compile speed.
I tried html file with live server, but it is compiled very fast.
so I think create-react-app has something wrong but I cannot understand of it
+
recently when I use "npx create-react-app . --template typescript" ,
when I do "npm run start" it changes tsconfig and makes lots of error about
"jsx" system
what's wrong with it. can anyone help me about my problem?
I assume you are having the problem of VSCode warns about the --jsx flag inside the tsconfig.json, that can be seen here.
You can fix like in here.
P.S: It would be very cool if the next time asking questions, you could format and proofread so that what you write is easier to understand.
I installed the new react/CRA versions. Right now when I have eslint errors the whole page blows and CRA fails to compile.
Sometimes I make some small test or debug something in the flow, and don't want CRA to fail the running only because of 1-2 intentional eslint errors.
Is there a possibility only to display the errors in the console, but not to fail to compile?
If it fails the npm run build it is okay.
Thanks and best regards