Migrating from aurelia-bundler + jspm to dumber.js (Aurelia 1)

Greetings.
I am currently trying to migrate our Aurelia 1 project from the very old aurelia-bundler (not the cli-bundler but the one used by old skeletons) + jspm to dumber.js, since it apparently supports Aurelia 1 with aurelia-deps-finder. We use TypeScript with tslib.

I have managed to at the very least build something, but there seem to be several problems with dependency injection which prevent the project from even starting:

  • “Uncaught (in promise) TypeError: Class extends value undefined is not a constructor or null”
    This is called by __extends from tslib, the constructor function of the superclass is undefined at runtime.
  • aurelia.use.standardConfiguration().globalResources(...) in main.configure breaks if some of these global resources need dependency injection (possibly only if said classes are not global, I have not checked):
@autoinject
export class SomeValueConverter { // this is in globalResources()
constructor(private service: SomeService) {} // the service is not in globalResources
}

This is the error heading:

Uncaught (in promise) Error: Error invoking LocalizeFloatValueConverter. Check the inner error for details.
Message: key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?
  • If for some reason the above errors do not happen (I think some bundles are loaded/executed in a non-deterministic order), the views cannot be loaded because they are not included in the bundles. This is definitely due to our unusual project structure: we do NOT and cannot use plain .html views because they need to be dynamically generated in the backend via Razor (ASP.NET Core). Is there a way to instruct the bundler (i assume via aurelia-deps-finder) to not try to include and load these from the bundles? (There might be more, but as I said I cannot reach this point reliably due to the previous errors.)

Please note that none of these problems occur with the legacy builder, which however we would like to migrate away from because of its age and some limitations (e.g. lack of ES6 syntax support).

Regards.

1 Like