Before activating or using Mega Drop Down on Modern sites, a feature called Script Support needs to be enabled on the site collection. This is a requirement from Microsoft. The feature only needs to be enabled once and only applies to SharePoint Modern sites.
(Get-SPSite -Identity "http://sharepoint.example.com/sites/modern").DenyPermissionsMask = [Microsoft.SharePoint.SPBasePermissions]::EmptyMaskReplace http://sharepoint.example.com/sites/modern with the URL to your site collection
Please use the steps listed in the following Microsoft article.