4

EDIT (added some information about my environment)

  • This is my second hybrid app, but first that I'm using a module loader.
  • I'm targeting Android 4,5,6 and iOS 7,8,9.
  • I'm developing on both windows 10 and ubuntu linux 15.10 (will use mac to publish to iOS store).
  • Using Cordova CLI v6.0.0.

I'm trying to use SystemJS to load my dependencies in my cordova app, however for some reason SystemJS is not able to resolve the paths correctly from my config.js file. It keeps resolving to something like

file:///android_asset/www/jspm_packages/npm/module@1.0.0.js

instead of

file:///android_asset/www/jspm_packages/npm/module@1.0.0/module.js

it works in a browser, just not when installed on the device. Anyone have any experience with this?

EDIT

I have a sample to reproduce the issue with precise steps on github - sample - it is a simple hello world using aurelia and systemjs.

weagle08
  • 1,763
  • 1
  • 18
  • 27
  • Please **answer the following questions in your post**. Since this appears to be your first post on this subject. Is this your first hybrid App? What is your target platform and their target versions? Android 4,5,6? iOS 7,8,9? What platform are you developing on? Windows, MacOS? Are you using [CLI, SDK or Build](https://github.com/jessemonroy650/top-phonegap-mistakes/blob/master/new-to-Phonegap.md#001) ? Please do not assume the answer, please read the link. Once you have answer the question *in the post*, respond in the comments so I know you have added information to the post. –  Feb 02 '16 at 08:24
  • updated my answer to respond to your questions about environment. – weagle08 Feb 02 '16 at 13:30
  • Thanks. I cleaned up you post. Also, this has nothing to do with Phonegap or *Phonegap Build*, a cloud-based service by Adobe/Phonegap. I'm confused as to why you want to use SystemJS. Cordova/Phoengap is not a webserver and is not a webbrowser. This is #5 of [Top Mistakes by Developers new to Cordova/Phonegap](https://github.com/jessemonroy650/top-phonegap-mistakes/blob/master/new-to-Phonegap.md) -- *When designing the app, thinks phonegap works like a website or webbrowser.* –  Feb 02 '16 at 21:41
  • I've been playing around with aurelia.io lately, and their default is to use jspm for package management at the moment. I was hoping that i could just carry the use of jspm (systemjs) over to the cordova app just to make things simpler. I'm looking into it more right now and will reply back with findings. – weagle08 Feb 03 '16 at 04:40
  • Okay. Get back to me. I can give you a more complete answer, if you like, but I'd need more information about your end goal. –  Feb 03 '16 at 05:29
  • i added a sample with steps on github. – weagle08 Feb 03 '16 at 05:52
  • I think it is just systemjs does not play well with cordova. – weagle08 Feb 03 '16 at 06:00

1 Answers1

0

My sample was fixed by another github user in the community and now works correctly for loading files in cordova with systemjs.

https://github.com/weagle08/aurelia-cordova-test

I will try to keep it up to date and working with latest systemjs.

weagle08
  • 1,763
  • 1
  • 18
  • 27