Skip to content

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

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

Closed
oguimbal opened this issue Dec 16, 2017 · 3 comments
Closed

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

oguimbal opened this issue Dec 16, 2017 · 3 comments

Comments

@oguimbal
Copy link

oguimbal commented Dec 16, 2017

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 ?

@oguimbal oguimbal 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' Dec 16, 2017
@playerx
Copy link

playerx commented Dec 18, 2017

yep, I've same silent error too
#8829

@oguimbal
Copy link
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.

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