Skip to content

AOT Build silent fail using scss file templates named 'xxxx.TS.scss' #8904

Closed

Description

@oguimbal

Versions

Angular CLI: 1.6.1
Node: 8.9.1
OS: win32 x64
Angular: 5.1.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.6.1
@angular-devkit/build-optimizer: 0.0.36
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.42
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.1
@schematics/angular: 0.1.11
@schematics/schematics: 0.0.11
typescript: 2.4.2
webpack: 3.10.0

Repro steps

Run command

ng new tsbug --style=scss
cd tsbug
mv src/app/app.component.scss src/app/app.component.ts.scss
sed -i 's/.scss/.ts.scss/g' src/app/app.component.ts
ng build --aot

(it just creates a new ng app using scss file named app.component.ts.scss, then AOT-builds it)

=> AOT build fails silently

nb1: ng build without --aot works like a charm.

nb2: this only happens when file is named xxx.TS.scss, see details below

nb3: this only happens with files that require a loader (not on html, or css ... i originally had this because i use a loader for .pug template files) and not only for styleUrls, but also templateUrl

Observed behavior

AOT build fails silently

image

Desired behavior

I would expect it to build, or at least yield a build error

Mention any other details that might be useful (optional)

Everything works fine with loaders, as long as your file names do not contain .ts

See app.component.ts

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html'
  styleUrls: ['./app.component.ts.scss'],  // <==== this one fails silently on ng build --aot
//  styleUrls: ['./app.component.scss'] // <==== this one is OK
})
export class AppComponent {
}

i assume there must be somewhere in the cli a /\.ts/.test(filename) that requires a $, or something of that kind ?

Activity

  1. changed the title [-]AOT Build silent fail using pug file templates named 'xxxx.TS.pug'[/-] [+]AOT Build silent fail using scss file templates named 'xxxx.TS.scss'[/+] on Dec 16, 2017
  2. playerx commented on Dec 18, 2017

    @playerx

    yep, I've same silent error too
    #8829

  3. oguimbal commented on Dec 18, 2017

    @oguimbal
    Author

    @playerx Well, I knew I must not be alone to name files like that :) But I did not find your issue, despite a lot of search.

  4. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    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.

  5. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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