-
Notifications
You must be signed in to change notification settings - Fork 644
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
Uncaught TypeError: Cannot read property 'nextSibling' of null #920
Comments
Hi, I also run in errors like |
@hedav85 Looks like yes! The error I'm seeing seems to be fixed if I apply the change in the PR. Thanks for the tip. Will leave this open till the PR gets merged properly. |
Actually, spoke too soon. Looks like the error above still occurs. |
@austinkelleher
|
I've also updated to 4.6 and get the following error if I switch the last dynamic include from the iteration. The example is available at https://github.com/hedav85/marko-test <p for(module in data.modules)>
<button on-click('toggleModule', module.name)>Switch</button>
<if(component.isActive(module.name))>
<include('../module', {name: module.name})/>
</if>
</p>
If I surround the include with a div it works well. <p for(module in data.modules)>
<button on-click('toggleModule', module.name)>Switch</button>
<if(component.isActive(module.name))>
<div>
<include('../module', {name: module.name})/>
</div>
</if>
</p> |
Same problem from version 4.5.0 or higher. Until version 4.4.28 this problem did not exist. |
This issue is really blocking my project at the moment. Is there anything I can do to help it along? |
@bohdyone one thing that would be helpful is if you could add a failing test case. You can take a look at similar tests in I hope we can try to get this issue resolved this week. |
@marko-js/core I have already checked in a failing test on a separate branch (`issue-920-domdiff-ssr): https://github.com/marko-js/marko/tree/bc745f11a75ac1398bf3e0180fb3af90373eb008/test/autotests/components-pages/nesting @DylanPiercey this is related to the fix we started on a month back. The problem occurs when we hydrate in the browser from a server-rendered page and the hydration incorrectly binds multiple UI components to the same DOM nodes. WIP fix: https://github.com/marko-js/marko/blob/82a7d9e7dc05d8e31894da44beea778132c44b0f/src/components/pairComponentNodes.js |
@patrick-steele-idem that test case was actually copied in here and is currently passing. I decided to patch the issue instead of applying your WIP fix (it was stuck in an infinite loop and I was having a hard time diagnosing the issue). Let me know if you have any feedback on those changes though. |
@hedav85 could you confirm if 4.7.1 has resolved your issue? |
@DylanPiercey I'll make a test today and give you some feedback. |
@DylanPiercey I testet the version 4.7 + 4.7.1 with my test example (https://github.com/hedav85/marko-test) and the bug is gone. It's now working. Thanks a lot! But it seems that I run into another issue with my current project (#946). |
@DylanPiercey Hi Dylan, @hedav85's issue may be fixed, but mine is not, as per my last comment. Can you reopen the issue please? I've also been time poor in terms of creating a new test case for this, but I might have some time over the next few days. It's not yet clear how to reproduce it outside of my project however. Just checking that the stacktrace I posted not sufficient to track down the problem? |
I am getting a similar error using marko 4.7.4
It is not something I can reproduce easily as it doesn't always happen with the same behaviour. I have logs in sentry recording that this is happening periodically. My case is not related to hydrating the rendering on the server. |
Bug Report
Marko Version: 4.5.6
Details
See an exception in the log. Also seeing occasional modelling errors -- such as some items in an each rendering twice. I'm guessing they're related. This happens when updates occur.
Expected Behavior
No error in log and items appear only once even when re-rendering
Actual Behavior
Items appear twice when updates trigger re-render
Possible Fix
It may be a concurrency issue, as I'm using Marko to build a Chrome extension, and events can actually come in between any async processing.
Additional Info
Your Environment
Google Chrome Version 62.0.3202.75 (Official Build) (64-bit)
Mac OSX High Sierra
Steps to Reproduce
Not sure how to reproduce it without using my project. I can send a link to it privately if needed.
Stack Trace
The text was updated successfully, but these errors were encountered: