create-react-app-typescript
create-react-app-typescript copied to clipboard
Uncaught TypeError: Cannot read property 'replace' of null
Is this a bug report?
Yes
Can you also reproduce the problem with npm 4.x?
Yes
Which terms did you search for in User Guide?
Uncaught TypeError: Cannot read property 'replace' of null
Environment
I tried 3 versions of node and npm, all produce this problem.
npm -v: 6.2.0 node -v: v10.9.0 yarn -v: 1.9.4
npm -v: 5.6.0 node -v: v8.5.0
npm -v: 4.1.2 node -v: v7.5.0
create-react-app -V: 1.5.2 react-scripts-ts: 2.17.0
Steps to Reproduce
- yarn global add create-react-app
- create-react-app xxx --scripts-version=react-scripts-ts
- cd xxx && yarn start
Expected Behavior
yarn start
everything works fine
Actual Behavior
yarn start
browser console report:
Uncaught TypeError: Cannot read property 'replace' of null
at getDataFiber (backend.js:9885)
at enqueueMount (backend.js:9572)
at mountFiber (backend.js:9640)
at backend.js:9700
at Set.forEach (<anonymous>)
at Object.walkTree (backend.js:9698)
at backend.js:8339
at <anonymous>:52:32
at Array.map (<anonymous>)
at Object.emit (<anonymous>:51:66)
at setupBackend (backend.js:8414)
at module.exports (backend.js:8360)
at Agent.<anonymous> (backend.js:114)
at Agent.g (backend.js:933)
at Agent.EventEmitter.emit (backend.js:846)
at backend.js:298
at backend.js:7426
at Array.forEach (<anonymous>)
at backend.js:7425
at Array.forEach (<anonymous>)
at Bridge._handleMessage (backend.js:7418)
at listener (backend.js:90)
Reproducible Demo
(Paste the link to an example project and exact instructions to reproduce the issue.)
I got the same error on console, But the app works fine . I use React.Fragment to replace some empty div,then errro occurred
I encountered this same problem. I fix this problem by downgrade react version from 16.5.2 to 16.2.1
I was having this problem too. Upgrading to react 16.6.0 resolved it for me.
Upgrading react-dom from 16.5.2 to 16.6.0 caused this error for me.
Exact same as betamire. Upgrading from 16.5.2 to 16.6.0.
As @batamire and @deadline98 have suggested, I got this error after upgrading react and react-dom to 16.6.0. I fixed this error by updating React DevTools, I had been running 3.4.1 and updated to 3.4.2. I just removed it and reinstalled it and the error went away and RDT worked correctly again. I'll note that my app was not created using create-react-app-typescript so your mileage may vary.
The error stack listed in the report refers to a function in the react-devtools browser extension, getDataFiber:
https://github.com/facebook/react-devtools/blob/3e1fba8efe26f6e4c955382d28401046fe1ae83e/backend/attachRendererFiber.js#L168
So this error does not seem to be related to CRA or CRA-TS in particular, it's just an outdated browser extension...