Custom post type single page 404

After a long search! I found a simple answer on a similar case.
just add this line in the custom post type register

"taxonomies" => [ "category", "product-category" ],

then it will do the magic!