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

[RC.5] Missing component when building/serving production version. WEIRD! #1645

Closed
dzonatan opened this issue Aug 11, 2016 · 4 comments
Closed

Comments

@dzonatan
Copy link
Contributor

angular-cli: 1.0.0-beta.11-webpack.2
node: 5.11.1
os: win32 x64

angular version: rc.5

Just read/do repro steps

1.Create fresh project with ng new.
2.Add anything.component.ts in src/app/shared folder with the following content:

import { Component } from '@angular/core';

@Component({
  selector: 'anything',
  template: 'Kim Jong-un'
})
export class AnythingComponent{ }

3.Add it to app.module.ts declarations:

...
import { AppComponent } from './app.component';
import { AnythingComponent } from './shared/anything.component'; // <--- HERE

@NgModule({
  declarations: [
    AppComponent,
    AnythingComponent // <---- AND HERE
  ],
...

4.Add anything element to app.component.html:

<h1>
  {{title}}
  <anything></anything> <!-- HERE -->
</h1>

5.Run ng serve. You should see app works! Kim Jong-un. Great!
6.Now the fun part. Run production version with ng serve --prod. You will only see app works!.

WHOOT? NO ERRORS! WHERE IS MY KIM??

@kylecordes
Copy link

I think this is the same problem as #1644 from a few minutes ago... which is the same also as angular/angular#10618

@dzonatan
Copy link
Contributor Author

Oh! You are right Kyle! Switching AppComponent with AnythingComponent solved the issue.
I'm closing this issue.

@abner
Copy link
Contributor

abner commented Aug 12, 2016

The solution proposed in #1644 worked for me:

...
mangle: { screw_ie8 : true, keep_fnames: true }, //prod

@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 6, 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

3 participants