Jonesopolis
Jonesopolis

Reputation: 25370

jspm and aurelia not working in webstorm

i've gone through Scott Allen's Hello World app, and have my Aurelia app working perfectly in visual studio.

For some reason, I'm unable to get the same result in WebStorm. My index.html body looks like:

<body aurelia-app>
    <script src="jspm_packages/system.js"></script>
    <script src="config.js"></script>
    <script>
        System.import("aurelia-bootstrapper");        
    </script>
</body>

and I'm met with a console error

Potentially unhandled rejection [3] Error loading "github:aurelia/[email protected]" at http://localhost:63342/jspm_packages/github/aurelia/[email protected]

the full error looks like:

enter image description here it looks like it's trying to grab a file [email protected], whne that's actually a folder. Why am I unable to get the exact same code working in webstorm as in visual studio?

Here's my bootstrapper section of my config:

"github:aurelia/[email protected]": {
  "aurelia-event-aggregator": "github:aurelia/[email protected]",
  "aurelia-framework": "github:aurelia/[email protected]",
  "aurelia-history": "github:aurelia/[email protected]",
  "aurelia-history-browser": "github:aurelia/[email protected]",
  "aurelia-loader-default": "github:aurelia/[email protected]",
  "aurelia-logging-console": "github:aurelia/[email protected]",
  "aurelia-router": "github:aurelia/[email protected]",
  "aurelia-templating": "github:aurelia/[email protected]",
  "aurelia-templating-binding": "github:aurelia/[email protected]",
  "aurelia-templating-resources": "github:aurelia/[email protected]",
  "aurelia-templating-router": "github:aurelia/[email protected]",
  "core-js": "npm:[email protected]"
},

and running jspm -v yields

C:\Users\Jones\WebstormProjects\Aurelia>jspm -v
0.15.7
Running against global jspm install.

Upvotes: 3

Views: 1185

Answers (3)

Jonesopolis
Jonesopolis

Reputation: 25370

Sigh. It was completely urelated to Aurelia, and totally related to my ineptitude as a web developer.

WebStorm hosts it's server at http://localhost:port/ProjectName/...

Hence, when I added my project name in the paths in config.js:

"paths": {
  "*": "*.js",
  "github:*": "Aurelia/jspm_packages/github/*.js",
  "npm:*": "Aurelia/jspm_packages/npm/*.js"
}

it all worked.

the more-correct way is to add the client url /ProjectName when running jspm init, and everything is handled for you.

Upvotes: 3

shanonvl
shanonvl

Reputation: 629

looks like it's trying to grab a file [email protected], whne that's actually a folder.

Actually there should be a folder and a .js like this:

jspm_packages\github\aurelia\[email protected] // descriptor
jspm_packages\github\aurelia\[email protected]    // folder

In your case, the .js seems to be missing. I've hit the before and I'm still not sure when/why this occurs, but when nothing else seems to fix it, I've just brute-forced...

(assuming windows b/c you mentioned visual studio)

Open cmd:

cd C:\Users\Jones\WebstormProjects\Aurelia
jspm install aurelia-bootstrapper --force

The --force should replace the missing .js:

jspm_packages\github\aurelia\[email protected]

If that file is present, restart your app and you should be good to go.

Upvotes: 4

PW Kad
PW Kad

Reputation: 14995

Can you check your config.js file and search for bootstrapper to see what version you have installed? Also please let me know of your version of jspm in console -

$ jspm -v

As long as bootstrapper is at 0.14.0 in your config.js and your jspm is a recent version (not beta) you should be good, if not let me know or try our gitter channel @ http://gitter.im/aurelia/discuss - if you don't get immediate resolution PM me and we can work through the issue and I'll update the answer.

Upvotes: 2

Related Questions