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

build fail when inlineCritical is enabled #25429

Closed
1 task done
vlio20 opened this issue Jun 23, 2023 · 2 comments
Closed
1 task done

build fail when inlineCritical is enabled #25429

vlio20 opened this issue Jun 23, 2023 · 2 comments

Comments

@vlio20
Copy link

vlio20 commented Jun 23, 2023

Command

build

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

15

Description

After upgrading to angular 16.1 I am getting an error:
An unhandled exception occurred: document.documentElement.setAttribute is not a function

When digging into the stacktrace I see that the error is coming from:

[error] TypeError: document.documentElement.setAttribute is not a function
    at createDocument (<MY_PATH>/webapp/node_modules/critters/dist/critters.js:519:30)

Minimal Reproduction

the command that i am runnig is:

ng build --configuration production

angular.json:
"optimization": true,

Exception or Error

[error] TypeError: document.documentElement.setAttribute is not a function
    at createDocument (<MY_PATH>/webapp/node_modules/critters/dist/critters.js:519:30)


### Your Environment

mac/ci (github actions)



### Anything else relevant?

when turning off `inlineCritical`

This setup works:
          "optimization": {
            "scripts": true,
            "styles": {
              "minify": true,
              "inlineCritical": false
            },
            "fonts": true
          },
@alan-agius4
Copy link
Collaborator

Duplicate of #25419

@alan-agius4 alan-agius4 marked this as a duplicate of #25419 Jun 23, 2023
@alan-agius4 alan-agius4 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 23, 2023
@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 24, 2023
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