Skip to content

AoT still compile spec files #2736

@antonybudianto7

Description

@antonybudianto7

Please provide us with the following information:

OS?

Linux, Ubuntu

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

angular-cli: 1.0.0-beta.17
node: 6.7.0
os: linux x64

Repro steps.

angular/angular#11276

  1. Generate new project
ng new test-app
  1. Open app.component.spec.ts
    and add RouterTestingModule
import { TestBed, async } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';

describe('App: TestBug', () => {
  beforeEach(() => {
    TestBed.configureTestingModule({
      declarations: [
        AppComponent
      ],
      imports: [
        RouterTestingModule
      ]
    });
  });
  1. Then try build
ng build -prod -aot
  1. Breaks
$ ng build -prod -aot                                                                              
Could not start watchman; falling back to NodeWatcher for file system events.                      
Visit http://ember-cli.com/user-guide/#watchman for more info.                                     
  0% compilingparameters received {"filePath":"/home/antony-budianto/Desktop/personal-project/test-
bug/node_modules/@angular/common/src/location/location.d.ts","name":"Location"} which is not a Stat
icSymbol                                                                                           
Error: parameters received {"filePath":"/home/antony-budianto/Desktop/personal-project/test-bug/nod
e_modules/@angular/common/src/location/location.d.ts","name":"Location"} which is not a StaticSymbo
l 

I know the issue about symbol already fixed in 2.1.0, but cli still compile spec files

Current workaround:

  • Add **/*.spec.ts to exclude option in src/tsconfig.json

The log given by the failure.

Please see angular/angular#11276

Mention any other details that might be useful.

AoT should not compile spec files


Thanks! We'll be in touch soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfultype: bug/fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions