Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'module' of undefined when using barrel and flatModuleOutFile #24476

Closed
alan-agius4 opened this issue Jun 13, 2018 · 3 comments

Comments

@alan-agius4
Copy link
Contributor

alan-agius4 commented Jun 13, 2018

I'm submitting a...


[x] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:

Current behavior

When using flatModuleOutFile and a barrel file to register a symbol to an NgModule an error is emitted TypeError: Cannot read property 'module' of undefined.

tsconfig

  "angularCompilerOptions": {
    "flatModuleId": "index.js",
    "flatModuleOutFile": "index.js"
  }

Module file

import { NgModule } from '@angular/core';
import { LibComponent } from './lib/index';

@NgModule({
  declarations: [LibComponent]
})
export class LibModule { }

Expected behavior

Build works without any error.

Minimal reproduction of the problem with instructions

https://github.com/alan-agius4/angular-issue-24476

Environment


Angular version: 6.0.4
Typescript: 2.7.2

Related issues:

#23713

ng-packagr/ng-packagr#917
ng-packagr/ng-packagr#943

@trotyl
Copy link
Contributor

trotyl commented Jun 13, 2018

Duplicate of #20931?

@alan-agius4
Copy link
Contributor Author

yes, thanks

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants