Category: reactjs

TFunction TS2345: Argument of type 'xyz' is not assignable to parameter of type 0

TFunction TS2345: Argument of type 'xyz' is not assignable to parameter of type

Property '$TFunctionBrand' is missing in type ... ERROR in src/pages/todos/todos.tsx:27:16 TS2345: Argument of type 'import("C:/dev/react-scss-jest-typescript/node_modules/react-i18next/ts4.1/index").TFunction<"translation", undefined>' is not assignable to parameter of type 'import("C:/dev/react-scss-jest-typescript/node_modules/i18next/typescript/t.v4").TFunction<"translation", undefined>'. Property '$TFunctionBrand' is missing in type 'import("C:/dev/react-scss-jest-typescript/node_modules/react-i18next/ts4.1/index").TFunction<"translation", undefined>' but...

Error: Can't resolve 'http' in ...\node_modules\https-browserify 0

Error: Can't resolve 'http' in ...\node_modules\https-browserify

ERROR in ./node_modules/https-browserify/index.js 1:11-26 Module not found: Error: Can't resolve 'http' in 'C:\dev\react-scss-jest-typescript\node_modules\https-browserify' BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case....

code: 'ERR_OSSL_EVP_UNSUPPORTED' error:0308010C:digital envelope routines::unsupported 0

code: 'ERR_OSSL_EVP_UNSUPPORTED' error:0308010C:digital envelope routines::unsupported

Starting the development server... C:\dev\react-scss-jest-typescript\node_modules\react-scripts\scripts\start.js:19 throw err; ^ Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:69:19) at Object.createHash (node:crypto:133:10) at module.exports (C:\dev\react-scss-jest-typescript\node_modules\webpack\lib\util\createHash.js:135:53) at NormalModule._initBuildHash (C:\dev\react-scss-jest-typescript\node_modules\webpack\lib\NormalModule.js:417:16) at C:\dev\react-scss-jest-typescript\node_modules\webpack\lib\NormalModule.js:452:10 at C:\dev\react-scss-jest-typescript\node_modules\webpack\lib\NormalModule.js:323:13 at C:\dev\react-scss-jest-typescript\node_modules\loader-runner\lib\LoaderRunner.js:367:11 at C:\dev\react-scss-jest-typescript\node_modules\loader-runner\lib\LoaderRunner.js:233:18 at...

TS2786: 'Button' cannot be used as a JSX component 0

TS2786: 'Button' cannot be used as a JSX component

When upgrading from react-scripts 4.X to 5.X Compiled with problems: × ERROR in src/App.tsx:51:10 TS2786: 'Button' cannot be used as a JSX component. Its return type 'ReactElement<any, string | JSXElementConstructor<any>> | null' is not...

React reload empty iframe cannot click anywhere 0

React reload empty iframe cannot click anywhere

https://stackoverflow.com/questions/70357360/process-is-not-defined-on-hot-reload Solution Add react-error-overlay 6.0.9 to "resolution" in package.json L "resolutions": { (...) "react-error-overlay": "6.0.9" }, 

Error: Node Sass version 6.0.1 is incompatible with ^4.0.0. 0

Error: Node Sass version 6.0.1 is incompatible with ^4.0.0.

./src/js/pages/security/audit/audit.scss (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-7-1!./node_modules/postcss-loader/src??postcss!./node_modules/resolve-url-loader??ref--6-oneOf-7-3!./node_modules/sass-loader/dist/cjs.js??ref--6-oneOf-7-4!./src/js/pages/security/audit/audit.scss) Error: Node Sass version 6.0.1 is incompatible with ^4.0.0. Solution Install "sass" in npm dev dependancies. You dont even need to remove other node-sass for this to work but you may remove...

Upgrade react-dom-router from 5.X to 6.X 0

Upgrade react-dom-router from 5.X to 6.X

Redirect => Navigate Switch => Routes history.replace() => navigate(to, {replace: true}); useHistory => useNavigate history.push() => navigate() navigate() usage You need to wrap your params inside navigate into a state: {} object. before:  ...