question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BFUDetailsListAuto Failed to construct 'IntersectionObserver': The provided value is not of type '(Element or Document)'

See original GitHub issue

I am working in a Blazor ClientSide .Net 5.0 project where I want to add a BFUDetailsListAuto component into my page. I followed the example shown (https://www.blazorfluentui.net/detailsListAutoPage) but after running my code I get the following error message:

Unhandled exception rendering component: Failed to construct ‘IntersectionObserver’: The provided value is not of type ‘(Element or Document)’

I have modified the DataItem class slightly:

public class DataItem
    {

        public DataItem()
        {

        }

        public DataItem(int num)
        {
            Key = num.ToString();
            KeyNumber = num;
            DisplayName = "temp" + Key;
            Description = "temp description" + Key;
        }

        public DataItem(string display, string key)
        {
            DisplayName = display;
            Key = key;
        }

        public DataItem(string text, SelectableOptionMenuItemType selectableOptionMenuItemType)
        {
            DisplayName = text;
            Type = selectableOptionMenuItemType;
        }
        public string Key { get; set; }
        public int KeyNumber { get; set; }
        public string DisplayName { get; set; }
        public string Description { get; set; }
        public SelectableOptionMenuItemType Type { get; set; }
    }

My DetailsList looks like this:

<BFUDetailsListAuto ItemsSource="dataSource"
                    Columns="columnsSource"
                    GetKey=@(x=>x.Key)
                    LayoutMode="DetailsListLayoutMode.Justified"
                    Selection="selection"
                    SelectionMode="SelectionMode.Multiple"
                    />

@code {

    Selection<DataItem> selection = new Selection<DataItem>();
    List<BFUDetailsRowColumn<DataItem>> columnsSource = new List<BFUDetailsRowColumn<DataItem>>();
    List<DataItem> dataSource = new List<DataItem>();
   protected override async Task OnInitializedAsync()
      {
  
            columnsSource.Add(new BFUDetailsRowColumn<DataItem, int>("Key", x => x.KeyNumber) {MinWidth=20, MaxWidth = 70, Index = 0, IsResizable = true });
          columnsSource.Add(new BFUDetailsRowColumn<DataItem, string>("Name", x => x.DisplayName) { Index = 1, MinWidth = 100, MaxWidth = 150, IsResizable = true });
          BFUDetailsRowColumn<DataItem, string> descriptionColumn = new BFUDetailsRowColumn<DataItem, string>("Description", x => x.Description) { Index = 2 };
          columnsSource.Add(descriptionColumn);
          int count = 0;
          for (var i = 0; i < 100; i++)
          {
              count++;
              dataSource.Add(new DataItem(count));
          }
  }
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
dominicusmentocommented, Apr 19, 2021

I think it’s something with DetailsListAuto component itself because I have the error too and I’ve managed to reproduce it in Demo project.

Copied Description column definition from DetailsListPageBasic.razor to DetailsListAutoPage.razor (and commented original definition) and the error is reproduced.

image

1reaction
vnbaaijcommented, Apr 26, 2021

V5.2.5 has been pushed to NuGet

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to construct 'IntersectionObserver': member root is ...
What is happening? Uncaught TypeError: Failed to construct 'IntersectionObserver': member root is not of type Element. at LazyLoad.
Read more >
Failed to execute 'observe' on 'IntersectionObserver' ...
The element returns as null because the script runs before the HTML is parsed. I used defer in my script tag to avoid...
Read more >
Experience Builder: Failed to construct 'IntersectionObserver'
When I try to open the URL a page comes out with: Failed to construct 'IntersectionObserver': member root is not of type Element....
Read more >
[Typescript and React] Please help me with this Error with ...
I am trying to use a reference to a html element with IntersectionObserver, but I get an Error 'Uncaught TypeError: Failed to execute ......
Read more >
IntersectionObserver: root property - Web APIs - MDN Web Docs
The IntersectionObserver interface's read-only root property identifies the Element or Document whose bounds are treated as the bounding box ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found