Writer Table of Contents generator not working in latest version

I have upgraded to the latest version of LibreOffice and the command Insert Table of Contents does not work I have used this command regularly in the previous version.
How can I get it to work in the new version?

Duplicate of Why does Inserting a Table of Contents not work in Version 4.2.5?

What is your OS? What is the version of LibO? Without this information nothing can be done.

You also can file a bug report here: https://www.libreoffice.org/get-help/bug/