Skip to content

Can't run extract-i18n if inline styles exist #20996

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
1 of 15 tasks
bgotink opened this issue May 31, 2021 · 2 comments
Closed
1 of 15 tasks

Can't run extract-i18n if inline styles exist #20996

bgotink opened this issue May 31, 2021 · 2 comments

Comments

@bgotink
Copy link
Contributor

bgotink commented May 31, 2021

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Yes, this worked in angular 11.x

Description

Running ng extract-i18n with at least one component that has inline styles will not succeed.

🔬 Minimal Reproduction

$ npx --package @angular/cli ng new repro
$ cd repro
$ yarn ng add @angular/localize
# if using BSD sed (e.g. macOS)
$ sed -i '' -e 's#styleUrls#styles#' -e 's#./app.component.css#:host {display: block}#' src/app/app.component.ts
# if using GNU sed (e.g. linux)
$ sed -i -e 's#styleUrls#styles#' -e 's#./app.component.css#:host {display: block}#' src/app/app.component.ts
$ yarn ng extract-i18n

🔥 Exception or Error

angular-resource:style,73733df977cae17daeb15e30f8c5975c:1:0 - Error: Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> :host {display: block}

🌍 Your Environment


     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 12.0.2
Node: 14.15.3
Package Manager: yarn 1.22.4
OS: darwin x64

Angular: 12.0.2
... animations, cli, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1200.2
@angular-devkit/build-angular   12.0.2
@angular-devkit/core            12.0.2
@angular-devkit/schematics      12.0.2
@schematics/angular             12.0.2
rxjs                            6.6.7
typescript                      4.2.4
    
Done in 1.08s.

Anything else relevant?

It looks like #20972 will fix this in 12.1

@alan-agius4
Copy link
Collaborator

Duplicate of #20968

@alan-agius4 alan-agius4 marked this as a duplicate of #20968 May 31, 2021
@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 Jul 1, 2021
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