Skip to content

Upgrading from 1.0.0 to 1.0.1 broke ng serve #6100

@kulshekhar

Description

@kulshekhar

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Upgrading from 1.0.0 to 1.0.1 broke ng serve. Any advice on how to fix/work around this would be very welcome.

Versions.

@angular/cli: 1.0.1
node: 6.10.2
os: linux x64

Repro steps.

git clone https://github.com/kulshekhar/ng-cli-repro
cd ng-cli-repro
yarn install
ng serve

Visit http://localhost:4200 in the browser.

The app, which works in the browser with 1.0.0, now shows a black screen with an error message listed below.

The log given by the failure.

In the browser:

Failed to compile.

./~/ionic-angular/util/ng-module-loader.js
54:11-36 Critical dependency: the request of a dependency is an expression

In the terminal:

** NG Live Development Server is running on http://localhost:4200 **
 94% asset optimizationwebpack: wait until bundle finished: /inline.bundle.js.map        
webpack: wait until bundle finished: /polyfills.bundle.js.map
webpack: wait until bundle finished: /styles.bundle.js.map
webpack: wait until bundle finished: /vendor.bundle.js.map
webpack: wait until bundle finished: /main.bundle.js.map
Hash: 101a5951ad0bf1ab39be
Time: 22355ms
chunk    {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 166 kB {4} [initial] [rendered]
chunk    {1} styles.bundle.js, styles.bundle.js.map (styles) 65.2 kB {4} [initial] [rendered]
chunk    {2} main.bundle.js, main.bundle.js.map (main) 3.88 kB {3} [initial] [rendered]
chunk    {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 4.1 MB [initial] [rendered]
chunk    {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]

WARNING in ./~/ionic-angular/util/ng-module-loader.js
54:11-36 Critical dependency: the request of a dependency is an expression

WARNING in ./~/ionic-angular/util/ng-module-loader.js
69:11-36 Critical dependency: the request of a dependency is an expression
webpack: Compiled with warnings.

Desired functionality.

The app should continue working in the browser despite the warning messages.

With 1.0.0, I received the same warnings as above in the terminal but the app continued to work fine in the browser. After upgrading to 1.0.1, the warnings in the terminal remain but the app no longer works in the browser. It shows a black screen with the above error message.

Mention any other details that might be useful.

The linked project, used in the steps to reproduce this issue, was create as follows:

  • ng new ng-cli-repro
  • cd ng-cli-repro
  • yarn add ionic-angular

At this stage, ng serve worked as expected.

  • Import and add IonicModule to app.module.ts as follows:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { IonicModule } from 'ionic-angular';

import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    IonicModule.forRoot(AppComponent)
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

At this stage, running ng serve exhibits the issue mentioned above.

As mentioned above, while the warnings in the terminal were visible even with 1.0.0, the app worked fine in the browser. However, after upgrading to 1.0.1, I now receive an error message in the browser.

I don't know if this would help in debugging/fixing this issue so for what it's worth,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions