Skip to content
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

ng -12 upgrade, getting missing property on build for production #20521

Closed
daddyschmack opened this issue Apr 13, 2021 · 16 comments
Closed

ng -12 upgrade, getting missing property on build for production #20521

daddyschmack opened this issue Apr 13, 2021 · 16 comments
Labels
needs: more info Reporter must clarify the issue

Comments

@daddyschmack
Copy link

ng build --configuration production --base-href /foo/

results in the following:
Browser application bundle generation complete.
ES5 Bundle generation Complete
copying assets complete
Index html generation failed.
undefined:6:6 property missing ':'

would it be possible to get a little more information on how this error can be troubleshot?

🐞 bug report

Affected Package

The issue is caused by package @angular/....

Is this a regression?

Yes, the previous version in which this bug was not present was: ....

Description

A clear and concise description of the problem...

🔬 Minimal Reproduction

https://stackblitz.com/...

🔥 Exception or Error





🌍 Your Environment

Angular Version:





Anything else relevant?

@zarend
Copy link

zarend commented Apr 13, 2021

Hello, we reviewed this issue and determined that it doesn't fall into the bug report or feature request category. This issue tracker is not suitable for support requests, please repost your issue on StackOverflow using tag angular.

If you are wondering why we don't resolve support issues via the issue tracker, please check out this explanation.

@zarend zarend closed this as completed Apr 13, 2021
@daddyschmack
Copy link
Author

daddyschmack commented Apr 14, 2021

Hi, my ask is that there should be a little more in the way of diagnostic information.. I have already asked the question for support or Gitter.. I mean, it's almost impossible to troubleshoot based on that information, right?
i mean, is the error referring to line 6 character 6 in the index? Does this request make a little more sense?
If it helps at all, the error does not occur on a non production build..

@petebacondarwin
Copy link
Contributor

Actually this is an issue for the CLI not the framework. So I am re-opening and transferring there.

@petebacondarwin petebacondarwin transferred this issue from angular/angular Apr 14, 2021
@petebacondarwin
Copy link
Contributor

But you will need to provide more of a reproduction to get any help here @daddyschmack

@alan-agius4
Copy link
Collaborator

The error thrown by this package https://www.npmjs.com/package/css ( https://github.com/reworkcss/css/blob/b7f3cb62dcb12f569189c38cbdb756553bf0415b/lib/parse/index.js#L224)

Without the CSS output we will not be able to determine what is the root cause of the issue, ie, if it causing by broken CSS output or is it a problem in the CSS AST parser (https://www.npmjs.com/package/css).

@alan-agius4 alan-agius4 added the needs: more info Reporter must clarify the issue label Apr 14, 2021
@alan-agius4
Copy link
Collaborator

Thanks for reporting this issue. However, you didn't provide sufficient information for us to understand and reproduce the problem. Please check out our submission guidelines to understand why we can't act on issues that are lacking important information.

If the problem persists, please file a new issue and ensure you provide all of the required information when filling out the issue template.

@daddyschmack
Copy link
Author

daddyschmack commented Apr 20, 2021 via email

@lsa-shanghai
Copy link

When our project update to 12, we face the same problem.
ng serve --hmr -o; It seems everything go welll.
ng build --configuration production; The error msg is:
✖ Index html generation failed.
undefined:3:102245: property missing ':'
Please note where to find more detail, Thanks.

@kemsky
Copy link

kemsky commented May 13, 2021

@alan-agius4 , well, it is kind of obvious that the error message is not helpful and also is misleading. CSS parsing failed, but it states Index html generation failed, should I debug index.html or ...?

The error can be caused by any (potentially valid) CSS, in my case, it was coming from "TinyMCE": "5.8.0" package:

            "styles": [
              "node_modules/tinymce/skins/ui/oxide/skin.css",
              "node_modules/tinymce/skins/ui/oxide/content.css"
            ],

CSS is syntactically correct, there are some non-critical errors, I've corrected them and tested using The W3C CSS Validation Service, then I applied fix to node_modules version, but angular-cli still fails to build the project with 100% correct CSS styles.

https://github.com/kemsky/angular-cli-bug

@daddyschmack
Copy link
Author

daddyschmack commented May 13, 2021 via email

@DeffiDeffi
Copy link

Experiencing the same error upgrading from Angular 11 to Angular 12, ng serve works, ng build fails but removing external imported styles (DevExtreme theme style files) in the angular.json seems to resolve it.

@hwebb
Copy link

hwebb commented May 14, 2021

I was able to pinpoint the issue on the CSS with only these 2 seemingly correct CSS (it worked well before on v11):
`.test1 {
background-image: url("data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3C!--%20Generator%3A%20Adobe%20Illustrator%2024.0.1%2C%20SVG%20Export%20Plug-In%20.%20SVG%20Version%3A%206.00%20Build%200)%20%20--%3E%0A%3Csvg%20version%3D%221.1%22%20id%3D%22dx_l_3%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%0A%09%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20style%3D%22enable-background%3Anew%200%200%2024%2024%3B%22%20xml%3Aspace%3D%22preserve%22%3E%0A%3Cpath%20style%3D%22fill%3Argba%280,%200,%200,%200.54%29%3B%22%20d%3D%22M12%2C2C6.5%2C2%2C2%2C6.5%2C2%2C12c0%2C5.5%2C4.5%2C10%2C10%2C10s10-4.5%2C10-10C22%2C6.5%2C17.5%2C2%2C12%2C2z%20M18%2C13H6v-2h12V13z%22%2F%3E%0A%3C%2Fsvg%3E%0A");
}

.test2 {
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDo etc");
}
`

It seems that the compilation fails at the bracket in the middle of that long string, removing that bracket solves the issue. But that CSS is auto-generated so it's quite complex to make any modification on it unfortunately.

But it doesn't seem to crash on stackblitz and it doesn't crash on a fresh new project as well.

I'm continuing my investigation to pinpoint exactly what configuration fails, but it can take a while, I hope the above can help others on this debugging quest.

@DeffiDeffi
Copy link

The workaround described in #20760 seems to fix this problem:
#20760 (comment)

@michal-husak
Copy link

change optimization: true in angular.json to:

image

it has something to do with css

@yfathi
Copy link

yfathi commented Jun 25, 2021

change optimization: true in angular.json to:

image

it has something to do with css

Thank you

"optimization": {
"scripts": true,
"styles": {
"minify": true,
"inlineCritical": false
},
"fonts": true
}

Worked for me ! with

@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 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: more info Reporter must clarify the issue
Projects
None yet
Development

No branches or pull requests

10 participants