Null reference from @Html.Kentico().PageBuilderScripts()

Pete Hubbel asked on January 2, 2020 17:02

In one of our environments, we are getting a null reference exception from:

@Html.Kentico().PageBuilderScripts()

Looking at a snippet of the stack trace:

... System.Web.Optimization.AssetManager.RenderExplicit(String tagFormat, String[] paths) +34 Kentico.PageBuilder.Web.Mvc.PageBuilderAssetsProvider.GetPageComponentsAdminScriptBundleTag() +154 Kentico.PageBuilder.Web.Mvc.HtmlHelperExtensions.PageBuilderScriptsInternal(ExtensionPoint`1 instance, IAllowedDomainsRetriever retriever, IComponentLocalizationService localizationService) +762 ...

Has anyone encountered this?

Recent Answers


Sean Wright answered on January 3, 2020 02:53

What does the JavaScript look like?

System.Web.Optimization was last updated in 2014 and can't support a lot of modern JavaScript language features.

I've seen errors like this when trying to load scripts written with ES2015+ and ES Modules.

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.