React create app hot reload is not always working on linux

When npm start doesn’t detect changes, below are the common troubleshooting steps provided in the create-react-app documentation – link. While an app is running with npm start and updating code in the editor should possibly refresh the broswer with the updated code. If this doesn’t happen, try one of the following workarounds: If the project … Read more

I’m getting error like this while creating react app

I think you are using Windows, I came across the same problem and it’s because of a security feature in your system. Open powershell as an administrator. Run the following command set-executionpolicy remotesigned Try again. This worked for me. Sources: https://www.faqforge.com/windows/windows-powershell-running-scripts-is-disabled-on-this-system/

How to set NODE_ENV from package.json for react

As per the docs, we cannot override NODE_ENV, but there is a room to create our own custom variables starting with REACT_APP_. So i configured to look as below: Reference: https://facebook.github.io/create-react-app/docs/adding-custom-environment-variables “staging”: “concurrently -k \”npm:staging-server\” \”cross-env REACT_APP_ENVIRONMENT=’staging’ PORT=3003 react-scripts start\””, And inside my UI application, I can fetch its value by consoling it like this: … Read more

React Typescript: Line 0: Parsing error: Cannot read property ‘name’ of undefined

The problem apparently was caused by a misconfiguration of some (peer?) dependencies of a dependency, react-scripts with the TypeScript template. It went away. Make sure you update your dependencies, purge node_modules, even purge package-lock.json or yarn.lock, and try a fresh build again now.

Module parse failed: Unexpected token (257:106) You may need an appropriate loader to handle this file type

I made a workaround. I compared my old and new package-lock.json of my projects and I saw some @babel lib version changed to v7.20.2 (on Nov 4th, 2022). I overwrote the new package-lock.json with old one and my react app built and ran successfully again. I then changed (downgrade) some of @babel package in my … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)