2

It's now been a few times I am getting this error. Using Sitecore 8.2 rev. 160729 along with SXA 1.2 rev. 161216, when I modify a SXA javascript file (ie. a component-* file) inside the Media Library > Wireframe > Themes > Scripts, everything works fine but after a while I get in JS console:

"Uncaught SyntaxError: Unexpected token >"

Inside the optimized javascript file that yields this error there indeed is a "<" missing at the first link tag after the jQuery code

enter image description here

This error is always yielded by a missing "<" at the end of the file I modified no matter what I modified, even if I put back the original version or just change an unsignificant character inside a string

As you can see, the portion of code that has the error corresponds to the source which does not miss the "<",

enter image description here

I get this error in sitecore logs in the middle of Indexes rebuild jobs,

10116 15:10:27 ERROR Application error.
Exception: System.NullReferenceException
Message: La référence d'objet n'est pas définie à une instance d'un objet.
Source: AjaxMin
   à Microsoft.Ajax.Utilities.JSParser.ParseUnaryExpression(Boolean& isLeftHandSideExpr, Boolean isMinus)
   à Microsoft.Ajax.Utilities.JSParser.ParseExpressionStatement(Boolean fSourceElement)
   à Microsoft.Ajax.Utilities.JSParser.ParseStatement(Boolean fSourceElement, Boolean skipImportantComment)
   à Microsoft.Ajax.Utilities.JSParser.ParseStatements(Block block)
   à Microsoft.Ajax.Utilities.JSParser.InternalParse()
   à Microsoft.Ajax.Utilities.Minifier.MinifyJavaScript(String source, CodeSettings codeSettings)
   à Sitecore.XA.Foundation.Theming.Bundler.AssetBundler.MinifyContent(MemoryStream memoryStream, StreamWriter writer, OptimizationType type)
   à Sitecore.XA.Foundation.Theming.Bundler.AssetBundler.PrepareContent(List`1 items, OptimizationType type, Boolean minify, StreamWriter writer, MemoryStream memoryStream)
   à Sitecore.XA.Foundation.Theming.Bundler.AssetBundler.CreateOptimizedItemForDirectory(Item directory, OptimizationType type, Boolean minify)
   à Sitecore.XA.Foundation.Theming.Pipelines.MediaRequestHandler.OptimizedFiles.ReGenerateOptimizedItem(String path, MediaRequest request)
   à Sitecore.XA.Foundation.Theming.Pipelines.MediaRequestHandler.OptimizedFiles.Process(MediaRequestHandlerArgs handlerArgs)
   à (Object , Object[] )
   à Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   à Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, Boolean failIfNotExists)
   à Sitecore.XA.Foundation.MediaRequestHandler.MediaRequestHandler.DoProcessRequest(HttpContext context)
   à Sitecore.Resources.Media.MediaRequestHandler.ProcessRequest(HttpContext context)
   à System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   à System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

After a few times waiting, the error sometimes goes away but I would like to have a way to fix it rightaway without losing time.

4
  • Could you please provide Sitecore and SXA versions? (revisions) Commented Jun 1, 2017 at 14:01
  • I am using Sitecore 8.2 along with SXA 1.2 rev. 161216 Commented Jun 1, 2017 at 14:03
  • What about Sitecore revision number? Commented Jun 1, 2017 at 14:04
  • Sorry, it is rev. 160729 Commented Jun 1, 2017 at 14:09

1 Answer 1

2

This seem to be not a bug in SXA

Could check whether you can download some media item (js/css) from media library and see how it behave? I can see server response with error appended to a file after I download it on a disk.

I reported such issue some time ago (November 2016) and it was an issue of Sitecore.

Unfortunately, the support page with this fix is no longer available. Reference number: 95901

Cached version

2
  • I can download and upload back media items but it won't change anything. I searched the logs for errors and I got the error I added to the question which is too long to be part of a comment (it seems to be linked but is in the middle of indexes updates jobs) Commented Jun 1, 2017 at 14:36
  • 1
    Well, it looks like minifier cannot minify JS because of this additional link in JS file, so this is just another symptom that there is something wrong but not with assets bundler by itself. If you cannot upgrade Sitecore I would recommend you to contact Sitecore support. I have never heard anybody in slack channel reporting issues like that. I might be wrong but I think it is related to this bug with download media. Commented Jun 1, 2017 at 23:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.