I'm trying to learn ReactJS. I just upgraded my dependencies' versions. I was using "npm start" command always for run my server. When I try that code I'm getting an annoying error like "webpack 5.65.0 compiled with 2 errors in 769 ms". I couldn't find my errors. I'm not a real developer. I'm just trying to learn and I'm stuck on this issue.
That's really complicated. So, I just want to uninstall Webpack. You can agree or disagree my idea but Webpack is really annoying. I'm really hate about this stupid thing. I didn't make any changes to my codes. I just updated the version of dependencies. Please help me. I couldn't uninstall Webpack and restore my simple and clear error screen that I am used to.
Related
I am doing a next js project with my friend. I want to run the project with vs code but when i run the commmand "yarn start", i get the following error:
There was a problem loading the local develop command. Gatsby may not be installed in your site's "node_modules" directory. Perhaps you
need to run "npm install"? You might need to delete your "package-lock.json" as well.
error Command failed with exit code 1.
I have done every thing to solve the problem but it is still there.I have re installed npm and gatsby.I have node installed but the problem is still there.I dont know how to fix it.Please guide me
I would highly recommend to delete the package-lock.json then navigate to the root folder of the project and run in the terminal "npm i", also make sure that You have created the nextjs project as in the guidance here -> https://nextjs.org/docs/api-reference/create-next-app
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.
Trying to run a React project I haven't touched in a week or so. When I run 'npm start' the project doesn't show up in my browser automatically anymore. My terminal says that it's being served locally. When I pasted in the address, it didn't show up and I received a 'not found' error . After about 5 min I tried again, and now the project shows up on localhost:5000. I am curious though as to why 'npm start' isn't automated like it should be with React. I tried making changes to my project, and the app in my browser isn't responding to any changes I'm making, even with a hard refresh. So far I've tried deleting node_modules and re-installing npm. I haven't found a thread on npm start that addresses this particular issue, so any advice is appreciated.
Okay, figured it out. For some reason the script for running in my
package.json changed to
"start": "serve -s build" I changed it to "react-scripts start" and that seemed to fix the problem. Not really sure what made it change in the first place.
I was going to redeploy a web app, so I was trying to run yarn build, and it runs into this error.
I am using Ant Design, I also did a yarn eject before, after a search through google still no luck, any encountered this is an error before? Any tips on solving it? thanks!
yarn run v1.22.0
$ react-app-rewired build
Creating an optimized production build...
Failed to compile.
./node_modules/antd/es/style/index.less
TypeError: this[MODULE_TYPE] is not a function
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Even I faced the same issue. My problem was I mixed up with Ant Design versions. Ant v4.x was released recently, so I used components without checking the version. So, try using components of same version and see if it works!!.
Okay, so for anyone who might face the same issue, you need to remove react-rewire and do the migration from V3 to V4 shown on Ant.Design Doc, then should be fine
Rather simple question really.
I come from a background of VueJS, where this is all setup for the user automatically. I'd like my linter (tslint, if that matters) to just run automatically when any file is saved in the project, but all the resources I've found stop at adding a command to the package.json file. Having a separate command for the linter is great and all, but I want those lint warnings to come up in the terminal while the dev server is running.
Edit: Not a duplicate of "How do I get tslint to watch for changes in a specific folder?" as that does not address what I'm looking to do. I can see that I can have a file watcher run separately from the server, but I do not want that. I'd like running the server to start the linter.
So this is what i was doing :
"watch": {
"lint": "src/main.ts"
},
"scripts": {
"lint": "tslint src/**/*.ts -t verbose",
"watch": "npm-watch"
},
for that you need npm-watch. Here is a good explanation How do I get tslint to watch for changes in a specific folder?
Hope it helps.
EDIT: I currently use VsCode and the TSLint plugin just shows everything on the IDE so i dont set it this way anymore
You can install vscode prettier plugin for exactly this.
After installing it, open your vscode settings (user/workspace) and enable Format on save as it respects the setting. Plus you can do it on language basis.
You can then configure your linters (ESLint/TSLint) to work with prettier.
More info is available on prettier's github repo - https://github.com/prettier/prettier-vscode
Maybe is little too late for the answer but since some CRA version you can extend "standard" eslint configuration with EXTEND_ESLINT environment variable. You can read about it in official docs and in this tutorial.
Linter configured this way is running with dev server.