-
Notifications
You must be signed in to change notification settings - Fork 46.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read property 'firstChild' of null at precacheChildNodes (react-dom.js:6619) #9351
Comments
And also on another code path:
|
Please create a minimal reproducing example. Otherwise we can't really help because there's no way to diagnose what happened. |
Yes, I'm trying to figure out what goes wrong. I suspect it has something to do with detached DOM trees. At least
|
See http://codepen.io/jochenberger/pen/wJbJpo?editors=0010#0 |
Yeah React seems totally broken. It breaks if you update state in any way, even without the select-element (if it isn't codepen breaking it). |
Looks like a bug in RC. |
I created a JSFiddle using |
The Codepen (here) is comparing a string value ("2") to a numeric value (2) which makes it appear to fail. Edit Actually that was just masking another error, which is the same one @acdlite and @flarnie were discussing last night:
I noticed this same error when running 15.5 rc1 against react-virtualized unit tests. (Haven't yet tracked down the cause though.) |
It appears to be related to reconciliation when the render output is different, specifically { this.state.value == 1 && <div>Selected 1</div>}
{ this.state.value == 2 && <div>Selected 2</div>} If you remove those two lines that conditionally render |
@nhunzaker no I don't think so. It looks like the lazy tree updates expect that an update be an actual node, but it's being passed as a string: |
@nhunzaker It is not caused by the |
@nhunzaker @aweary FWIW there were 6 cherrypicked commits in the 15.5-dev branch. The rest of the changes were deprecations and small relocations. The cherrypicked commits were: fe4a5b4 Fix Chrome number input backspace and invalid input issue (#7359) |
AFAICT the issue stems from the fact that an I'm not sure how it relates to those commits yet 🤔 |
It might be because |
And that is because code from the shallow renderer is being included and parsed in cc @gaearon @trueadm it looks like it's probably related to the new build process then? If you go to https://unpkg.com/react-dom@15.5.0-rc.1/dist/react-dom.js and search for |
New build process isn’t in React 15.5, only in master. Good investigation though! |
Nice find, @aweary. Dan's right, the 15.5 build process is a bit of a one-off. |
This is because of my changes in 3a7eef2. I'm on it! |
Fixed with 714e5ea. Fix will go out with our next rc 2 release in a few moments. |
Sorry for the inconvenience! Thanks for reporting this @jochenberger and for help identifying the cause @aweary! You rock! |
Took us a bit longer than anticipated, but RC 2 was just released and fixes this issue. Thanks again for reporting it! |
With 15.5.0-rc.1, I get
The text was updated successfully, but these errors were encountered: