Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Pin css-select to latest compatible version #117

Closed
wants to merge 1 commit into from

Conversation

PowerKiKi
Copy link

The proper long-term solution is discussed in
#103 (comment) but until then we should at least not break existing install that upgrade their dependencies.

Without this we would get errors similar to:

rules skipped due to selector errors

Fixes #103

The proper, long-term solution is discussed in
GoogleChromeLabs#103 (comment)
but until then we should at least not break existing install that
upgrade their dependencies.

Without this we would get errors similar to:

```
rules skipped due to selector errors
```

Fixes GoogleChromeLabs#103
@PowerKiKi
Copy link
Author

@developit, @alan-agius4, this is at least the temporary solution for the issue we talked about in #103. Until an important refactor is done. This should be a no-brainer to merge and release as a patch version. Could you please try to bring this up to the Google team/Angular team ?

It would solve the issue for a lot of people that otherwise have to resort to poor workaround as seen in

@XhmikosR
Copy link

XhmikosR commented Nov 23, 2022

I was about to suggest this too after digging into my node_modules and found that the error is coming from a minor version bump in css-select.

My only concern is that angular 13 and 14 that I use, are using [email protected]:

C:\Users\xmr\Desktop\app\dev>npm ls critters
[email protected] C:\Users\xmr\Desktop\app\dev
`-- @angular-devkit/[email protected]
  `-- [email protected]

So, in order for this to be fixed, we'll need a new 0.0.x version and angular to update to that patch version and release new patch versions of angular...

@PowerKiKi
Copy link
Author

Indeed all supported Angular versions pinned the exact version to 0.0.16, so they will need to release a new Anglar version in order for this PR to have any effect:

That's not ideal, but hopefully @alan-agius4 will be able to help us with that when this PR is released...

In the mean time, if you use yarn, you can add this to your package.json:

{
    ...
    "resolutions": {
        "css-select": "4.2.1",
        "css-what": "5.1.0",
        "domhandler": "4.3.1"
    },
    "dependencies": {
        ...
    }
}

@Jake-Thomas-Hall
Copy link

Indeed all supported Angular versions pinned the exact version to 0.0.16, so they will need to release a new Anglar version in order for this PR to have any effect:

That's not ideal, but hopefully @alan-agius4 will be able to help us with that when this PR is released...

In the mean time, if you use yarn, you can add this to your package.json:

{
    ...
    "resolutions": {
        "css-select": "4.2.1",
        "css-what": "5.1.0",
        "domhandler": "4.3.1"
    },
    "dependencies": {
        ...
    }
}

Would just like to add, thank you for this workaround. For anyone using npm and who has gone down this rabbit hole, below is what you need to add to your package.json for now until this change to critters is merged and updated into Angular.

Note that I've got Angular 15.0.1, Typescript 4.8.4 and Bootstrap 5.2.3 installed.

Overriding the version of css-select from 4.2.0 to 4.2.1 fixed the warning for me:

image

package.json:

{
   ...
   "overrides": {
       "css-select": "^4.2.1"
       // These may be optional, check the versions present in your package-lock.json, if they're already this version or later no need to include
       "css-what": "^5.1.0"
       "domhandler": "^4.3.1"
   }
   ...
}

@weilinzung
Copy link

weilinzung commented Nov 30, 2022

Indeed all supported Angular versions pinned the exact version to 0.0.16, so they will need to release a new Anglar version in order for this PR to have any effect:

That's not ideal, but hopefully @alan-agius4 will be able to help us with that when this PR is released...
In the mean time, if you use yarn, you can add this to your package.json:

{
    ...
    "resolutions": {
        "css-select": "4.2.1",
        "css-what": "5.1.0",
        "domhandler": "4.3.1"
    },
    "dependencies": {
        ...
    }
}

Would just like to add, thank you for this workaround. For anyone using npm and who has gone down this rabbit hole, below is what you need to add to your package.json for now until this change to critters is merged and updated into Angular.

Note that I've got Angular 15.0.1, Typescript 4.8.4 and Bootstrap 5.2.3 installed.

Overriding the version of css-select from 4.2.0 to 4.2.1 fixed the warning for me:

image

package.json:

{
   ...
   "overrides": {
       "css-select": "^4.2.1"
       // These may be optional, check the versions present in your package-lock.json, if they're already this version or later no need to include
       "css-what": "^5.1.0"
       "domhandler": "^4.3.1"
   }
   ...
}

We have to do this in order to fix it temporarily, without nested override won't do anything.

  "overrides": {
    "@angular-devkit/build-angular": {
      "critters": {
        "css-select": "4.2.1"
      }
    }
  }

@XhmikosR
Copy link

@developit friendly ping 🙂

@alan-agius4
Copy link
Contributor

This has been addressed as part of 0.17.0

@PowerKiKi
Copy link
Author

Superseeded by #124, which was released as 0.0.17

@PowerKiKi PowerKiKi closed this May 30, 2023
@PowerKiKi PowerKiKi deleted the issue-103 branch May 30, 2023 13:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rules skipped due to selector errors: legend+* -> Cannot read property 'type' of undefined
5 participants