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.