After installing my app on another machine, I do reach an error on browser side:
Uncaught Invalid provider - only instances of Provider and Type are allowed, got: [object Object]
This seems to be linked to a wrong bootstrapping of the provider. But nothing seems wrong. Any idea what's wrong ?
Packages
"@angular/common": "^2.0.0-rc.4",
"@angular/compiler": "2.0.0-rc.4",
"@angular/core": "2.0.0-rc.4",
"@angular/forms": "^0.2.0",
"@angular/platform-browser": "2.0.0-rc.4",
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
"@angular/router": "^3.0.0-beta.2",
"angular2-meteor": "^0.6.2",
"angular2-meteor-auto-bootstrap": "^0.6.0",
"angular2-meteor-polyfills": "^0.1.1",
"angular2-pagination": "^0.2.1",
"core-js": "^2.4.0",
"es6-shim": "^0.35.1",
"hammerjs": "^2.0.8",
"jquery": "^3.0.0",
"meteor-node-stubs": "~0.2.0",
"reflect-metadata": "0.1.2",
"route-matcher": "^0.1.0",
"rxjs": "5.0.0-beta.6",
"zone.js": "^0.6.12"
Code
import 'reflect-metadata';
import 'zone.js/dist/zone';
import { bootstrap } from 'angular2-meteor-auto-bootstrap';
import { Component, provide, PLATFORM_DIRECTIVES } from '@angular/core';
import { disableDeprecatedForms, provideForms } from '@angular/forms';
import { APP_BASE_HREF } from '@angular/common';
import { provideRouter, RouterConfig, Routes, ROUTER_DIRECTIVES } from '@angular/router';
import { Home } from '../imports/business/home';
export const routes: Routes = [{ path: '', component: Home, data: {prettyName: 'Accueil'} }];
@Component({
moduleId: module.id,
selector: 'app',
template: require('./app.html').default,
directives: [ROUTER_DIRECTIVES],
})class App{}
bootstrap(App, [
disableDeprecatedForms(),
provideForms(),
provideRouter(routes),
provide(PLATFORM_DIRECTIVES, { useValue: [ROUTER_DIRECTIVES], multi: true })
]);
PS: that is not the exact same version, but the exception is thrown here https://github.com/vicb/angular/blob/b8450fa68f704f5f7f0f119034f5e4242664b172/modules/angular2/src/core/di/provider.ts#L567
EDIT This is apparently linked to "@angular/router" and "angular2-meteor-auto-bootstrap" versions that I updated. They had some dependencies to rc.5 and apparently this version change is not backward compatible for my app.
If anyone has an explanation...