Bitfiddler
Bitfiddler

Reputation: 4202

Aurelia plugin path error

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?

Upvotes: 2

Views: 159

Answers (1)

arunteja dhondi
arunteja dhondi

Reputation: 9

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

Upvotes: 0

Related Questions