4

We have deployed a jss app to a Content Delivery server.

We have followed instructions to add jss support to the server role.

Links to media items generated by Image components begin with /-/jssmedia and 404.

Changing the generated urls to start with /-/media makes them serve an image.

The error in the logs for broken links is this:

3392 11:43:27 ERROR Application error.
Exception: System.Web.HttpException
Message: The file '/-/jssmedia/cms-sitecore/data/media/img/sitecorejss_media.ashx' does not exist.
Source: System.Web
   at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate)
   at System.Web.UI.SimpleHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
   at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

IIS Handler Mappings

On the Content Delivery server, IIS Site > Handler Mappings shows the sitecore_media.ashx endpoint. It does not have a sitecorejss_media.ashx endpoint.

On a Content Management server, where the images are showing up, the sitecorejss_media.ashx endpoint is registered.

3

What we did:

Located the file Sitecore.JavaScriptServices.MediaRequestHandler.jssconfig in the App_Config directory.

Pulled out the line where it defines the handler, and added it to end of the system.webServer/handlers section of the root web.config.

The patch looks like this:

      <add verb="*" path="sitecore_expeditor_speak_request_async.ashx" type="Sitecore.ExperienceEditor.Speak.Server.RequestAsyncHandler, Sitecore.ExperienceEditor.Speak" name="Sitecore.ExperienceEditor.Speak.Server.RequestAsyncHandler" />
      <add verb="*" path="sitecorejss_media.ashx" type="Sitecore.JavaScriptServices.Media.MediaRequestHandler, Sitecore.JavaScriptServices.Media" name="Sitecore.JavaScriptServices.Media.MediaRequestHandler" />
    </handlers>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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