I had the same error on my Angular6 project. none of those solutions seemed to work out for me. turned out that the problem was due to an element which was specified as dropdown
but it didn't have dropdown options in it. take a look at code below:
<span class="nav-link" id="navbarDropdownMenuLink" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<i class="material-icons "
style="font-size: 2rem">notifications</i>
<span class="notification"></span>
<p>
<span class="d-lg-none d-md-block">Some Actions</span>
</p>
</span>
<div class="dropdown-menu dropdown-menu-left"
*ngIf="global.localStorageItem('isInSadHich')"
aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="#">You have 5 new tasks</a>
<a class="dropdown-item" href="#">You're now friend with Andrew</a>
<a class="dropdown-item" href="#">Another Notification</a>
<a class="dropdown-item" href="#">Another One</a>
</div>
removing the code data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
solved the problem.
I myself think that by each click on the first span element, the scope expected to set style for dropdown children which did not existed in the parent span, so it threw error.