4

After bundling a simple aurelia application with jspm bundle-sfx I get the following error:

No PLATFORM.Loader is defined and there is neither a System API (ES6) or a Require API (AMD) globally available to load your app.

An example application: https://github.com/Baudin999/jspm-bundling-test

You can use: npm run setup:dev in a non windows env to switch back to the dev settings (which is just a comment/uncomment in the ./src/client/index.html) and you can use npm run setup:prod to switch back to the production environment, bundling will automatically be triggered. all other scripts can be found in the package.json.

I can't link to other questions because I haven't found any questions which relate to this problem. I "think" (which means absolutely nothing) that this might be related to the fact that aurelia needs a full loader even when bundling with bundle-sfx but I haven't found any ways to solve the error.


EDIT (25/01/2017 17:16): I've found out that the error is because I import the aurelia-bootstrapper. As soon as I add: import * as bootstrapper from 'aurelia-bootstrapper'; I get the error


Mr. Baudin
  • 2,104
  • 2
  • 16
  • 24

1 Answers1

0

Please add the code how do you bootstrap your aurelia app.
There is nothing actually to import from bootstrapper apart from bootstrap function. Which you would use in case of custom manual bootstrapping.

like in

import { bootstrap } from 'aurelia-bootstrapper'
const configure: (au: Aurelia) => {} = async function (au: Aurelia) {


    au.use
        .standardConfiguration();

    await au.start()
    au.setRoot() // or au.enchance()
})

bootstrap(configure)

in a happy path scenario with jspm - you System.import('aurelia-bootstrapper') and it takes over finding the root node of your app and the script to configure Aurelia (main by default)

Have a look at Bootstrapping Aurelia in the docs

Oh.. and bundle-sfx is not supported there are other means to bundle aurelia apps using jspm

Alexander Taran
  • 6,655
  • 2
  • 39
  • 60
  • 1
    Thank you for answering. I had an example application with the bootstrapping etc. This question is very old and if I could I would "close" it. I myself have moved to React. I don't even have the example anymore – Mr. Baudin Mar 07 '18 at 13:48
  • Well seing that there are at least 4 upvotes to your question I assumed there are others with the same question. So it was worth answering – Alexander Taran Mar 07 '18 at 14:03
  • You are completely right, but I don't have my old bootstrap code anymore. If I had it I would have posted it. I know this makes this issue irrelevant and I would love to close it. – Mr. Baudin Mar 07 '18 at 14:51