Jspm and aurelia not working in webstorm

I went through Scott Allen Hello World app and my Aurelia app works fine in visual studio.

For some reason, I can't seem to get the same result in WebStorm. The body of index.html looks like this:

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

      

and i am meeting with console error

Potentially unhandled rejection [3] Error loading "github: aurelia / bootstrapper@0.14.0 " to http: // localhost: 63342 / jspm_packages / github / aurelia / bootstrapper@0.14.0.js

the complete error looks like this:

enter image description here it looks like it is trying to grab a file boostrapper@0.14.0.js

, which is actually a folder. Why can't I get the same code working in webstorm like in visual studio?

Here's my bootstrapper section of my config:

"github:aurelia/bootstrapper@0.14.0": {
  "aurelia-event-aggregator": "github:aurelia/event-aggregator@0.6.1",
  "aurelia-framework": "github:aurelia/framework@0.13.2",
  "aurelia-history": "github:aurelia/history@0.6.0",
  "aurelia-history-browser": "github:aurelia/history-browser@0.6.1",
  "aurelia-loader-default": "github:aurelia/loader-default@0.9.0",
  "aurelia-logging-console": "github:aurelia/logging-console@0.6.0",
  "aurelia-router": "github:aurelia/router@0.10.1",
  "aurelia-templating": "github:aurelia/templating@0.13.2",
  "aurelia-templating-binding": "github:aurelia/templating-binding@0.13.0",
  "aurelia-templating-resources": "github:aurelia/templating-resources@0.13.0",
  "aurelia-templating-router": "github:aurelia/templating-router@0.14.0",
  "core-js": "npm:core-js@0.9.18"
},

      

and it works jspm -v

gives

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

      

+3


source to share


3 answers


Sigh. It was completely stripped down by Aurelia and completely related to my inappropriateness as a web developer.

WebStorm hosts it on the server http://localhost:port/ProjectName/...

Hence when I added the project name in the path to config.js

:



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

      

everything worked.

the more correct way is to add the client url /ProjectName

at startup jspm init

and everything will be handled for you.

+3


source


it looks like it is trying to grab the boostrapper@0.14.0.js file which is actually a folder.

There should actually be a folder and .js:

jspm_packages\github\aurelia\bootstrapper@0.14.0.js // descriptor
jspm_packages\github\aurelia\bootstrapper@0.14.0    // folder

      

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

(assuming Windows b / c you mentioned visual studio)



Open cmd:

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

      

--force

should replace missing .js:

jspm_packages\github\aurelia\bootstrapper@0.14.0.js

      

If this file is present, reload the application and you should be good to go.

+4


source


Can you check your file config.js

and search bootstrapper

to see which version was installed? Also let me know about your jspm version in the console -

$ jspm -v

      

As long as the boot block is at 0.14.0 in your config.js and your jspm is the latest version (not beta) you should be good if you don’t tell me or try our gitter @ http: // gitter channel .im / aurelia / discuss - unless you get immediate permission from PM me and we can fix the problem and I'll update the answer.

+2


source







All Articles