Skip to content

Commit

Permalink
Fix where modules fail to compile e.g. not-a-module
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Feb 6, 2018
1 parent 8f42970 commit 56af3e3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/JBrowse/Browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,7 @@ initPlugins: function() {

// fire the "all plugins done" deferred when all of the plugins are done loading
(new DeferredList( pluginDeferreds ))
.then( function() {
deferred.resolve({success: true});
});
.then( function() { deferred.resolve({success: true}); });

require( {
packages: array.map( plugins, function(p) {
Expand Down
4 changes: 4 additions & 0 deletions src/JBrowse/GenomeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -2309,6 +2309,10 @@ renderTrack: function( /**Object*/ trackConfig ) {

// get the track class
require( [ trackConfig.type ], function( class_ ) {
if(typeof class_ === "string") {
console.error("Failed to load module: "+trackConfig.type);
return;
}
trackClass = class_;
if( trackClass && store )
makeTrack();
Expand Down
5 changes: 5 additions & 0 deletions src/JBrowse/View/Track/CanvasFeatures.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,11 @@ return declare(


require( [glyphClassName], function( GlyphClass ) {
if( typeof GlyphClass == 'string' ) {
thisB.fatalError = "could not load glyph "+glyphClassName;
thisB.redraw();
return;
}
// if this require came back after we are already destroyed, just ignore it
if( thisB.destroyed )
return;
Expand Down

0 comments on commit 56af3e3

Please sign in to comment.