Background
I am trying to use the PageDown JavaScript library:
- Markdown.Converter.js - (click to view source)
- Markdown.Editor.js - (click to view source)
- Markdown.Sanitizer.js - (click to view source)
Note: the above links to a forked repo. This is the original StackExchange PageDown repo.
But when I try and load 3 JavaScript files using <ltng:require
code below:
<aura:component controller="MyController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId"
access="global">
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<ltng:require scripts="{!join(',',
$Resource.Markdown_Converter,
$Resource.Markdown_Sanitizer,
$Resource.Markdown_Editor
)}"
afterScriptsLoaded="{!c.afterScriptsLoaded}" />
<!-- other code -->
</aura:component>
But only the first static resource loads and the afterScriptsLoaded
method never fires.
Controller.js
({
doInit: function (component, event, helper) {
console.log("doInit 1");
},
afterScriptsLoaded: function (component, event, helper) {
console.log("afterScriptsLoaded 1");
}
})
Each JavaScript static resource file has:
cacheControl
ofPublic
contentType
ofapplication/javascript
.
Markdown_Converter.resource-meta.xml
<?xml version="1.0" encoding="UTF-8"?>
<StaticResource xmlns="http://soap.sforce.com/2006/04/metadata">
<cacheControl>Public</cacheControl>
<contentType>application/javascript</contentType>
</StaticResource>
And there are no errors in the console:
And Network show no 404/403/401's
Questions
- What is causing this?
- How do I fix it?