2
votes

I installed aurelia-breadcrumbs using jspm. config.js file has a map entry:

 "heruan/aurelia-breadcrumbs": "github:heruan/[email protected]"

The config.js also has a path entry:

"github:*": "jspm_packages/github/*"

In my project under the directory jspm_packages/github/heruan, there are files/folders relating to aurelia-breadcrumbs.

In my boostrap config I have:

aurelia.use
    .standardConfiguration()
    .feature('src/resources')
    .developmentLogging()
    .plugin("heruan/aurelia-breadcrumbs");    

However, the plugin is not being mapped properly and it cannot find the aurelia-breadcrumbs.js file (error 404 in the browser).

Uncaught (in promise) Error: (SystemJS) XHR error (404 Not Found) loading http://localhost:7987/heruan/aurelia-breadcrumbs.js

When I look in the 'sources' tab in chrome developer tools, the breadcrumbs plugin no longer appears under jspm_packages/github.

What am I missing?

1
What happens if you change the line in config.js "heruan/aurelia-breadcrumbs": "github:heruan/[email protected]" to "aurelia-breadcrumbs": "github:heruan/[email protected]"? - Ashley Grant
My best guess is that some config information needs to be added to the jspm registry for this plugin to teach JSPM/SystemJS what it needs to do to make this plugin work. - Ashley Grant
I thought so as well and I tried to switch the config exactly as you suggested, but then I was getting the same error with a different URL. I just abandoned using this plugin. I don't have the time to debug it at the moment. It doesn't look like it's been touched in 6 months and given how often Aurelia is changing, it leads me to believe it might be abandoned. - Bitfiddler
To fix this with JSPM/SystemJS you would have to learn how "overrides" work. github.com/jspm/registry/wiki/Configuring-Packages-for-jspm - Ashley Grant
I am getting the same error 404. Can you please help me how did you fix it? - Dexterslab

1 Answers

0
votes

In the /jspm_packages/github/heruan/[email protected]/dist/commonjs/index.js file, please change this

function configure(frameworkConfiguration, config) {
    frameworkConfiguration.globalResources('./breadcrumbs.js');
}

from

function configure(frameworkConfiguration, config) {
    frameworkConfiguration.globalResources('/jspm_packages/github/heruan/[email protected]/dist/commonjs/breadcrumbs.js');
}

this change is because,index.js file is unable to load ./breadcrumbs.js due to some path issue or some other,instead if we provide relative path then it is loading the file