Currently the angular compiler does something strange when exporting the decorators:
AlertModule.decorators = [
{ type: NgModule, args: [{
declarations: [AlertComponent],
imports: [
CommonModule
],
exports: [AlertComponent],
},] }
];
When it should do:
AlertModule = __decorate([
NgModule({
declarations: [AlertComponent],
imports: [
CommonModule
],
exports: [AlertComponent]
})
], AlertModule);
// INFO: __decorate comes from 'tslib'
So on my side, following the angular tutorial, when importing the component in an angular project is not working.
If it may helps: I get a Value at position X in the NgModule.imports of AppModule is not a reference. Ivy is enabled, and I'm using Angular 9.
When Ivy is disabled: ERROR in Unexpected value 'BitDevTestModule in [path] imported by the module 'AppModule in [path] . Please add a @NgModule annotation.
Actually, after further investigations, the angular tutorial doesn't work at all for angular 9+. But works fine only with angular 8
Found a workaround: import { AlertModule } from '@bit/[name].[collection].alert/dist'; Note that I must append /dist at the end to make it work properly
Fixed there: https://github.com/teambit/envs/pull/154