SPFx Extensions is not loading when accessing Documents Page.

New Contributor

I've got an SPFx Extension which works fine until user pick any List from QuickLaunch Menu. It throws an error that reads:

VM18:1 Uncaught SyntaxError: Unexpected token r in JSON at position 0

sp-pages-assembly_pl-pl_80ffc67e026290d635d98a5e7caa0077.js:1 Uncaught TypeError: Cannot read property 'querySelectorAll' of null


Which I inspected and it seems to me like it has something to do with highlihting elements. If I refresh the page (by F5 or just click one more time on same List in QuickLaunch) the SPFx Extension works perfect. It looks like due to this error the extension's code isn't even loaded to the site.

Did anyone stumbled across anything like that? I feel like I'm hitting a wall here since I can't event work it around because my code isn't even loaded.




2 Replies

@Iwo_Misztal try to add extention to the bottom/footer of the page, usually it is layout or JS which are loaded by default issue, I document view you might need to preload/wait for something else to complete first.


Thank you so much for your reply! Unfortunatelly, even if I attach the extension to bottom placeholder it doesn't fix the issue. I worry it has something to do with the Documents tab itself. I feel like the error triggers before my code is even loaded and prevents it from beeing executed (since if I am already on Documents tab and refresh the page, the extension works).