question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

Bug description:

When building angular using the production configuration, the step Generating index html... produces following warning: 1 rules skipped due to selector errors: legend+* -> Cannot read property 'type' of undefined

See this screenshot: image

Reproduction Steps

In Terminal:

ng new testproject --style scss
cd testproject
ng add @ng-bootstrap/ng-bootstrap
npm run build

Versions of Angular, ng-bootstrap and Bootstrap:

Angular: 13.3.0 - 13.3.2

ng-bootstrap: 12.0.2

Bootstrap: 5.1.3

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:20
  • Comments:57 (1 by maintainers)

github_iconTop GitHub Comments

17reactions
hhubikcommented, May 20, 2022

Had the same issue. Managed to solve it by replacing "optimization": true in angular.json with

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

As suggested in https://mdbootstrap.com/support/angular/angular-12-production-build-warning-mdb4-12/

9reactions
ImmuneGitcommented, Apr 22, 2022

I get even two messages:

Warning: 2 rules skipped due to selector errors:
  legend+* -> Cannot read properties of undefined (reading 'type')
  legend + * -> Cannot read properties of undefined (reading 'type')

It’s because you installed bootstrap and ng-bootstrap

Read more comments on GitHub >

github_iconTop Results From Across the Web

Warning: 1 rules skipped due to selector errors: legend + ...
In the angular.json file write the following code, under "production". "optimization": { "scripts": true, "styles": { "minify": true, ...
Read more >
Angular Universal 'Rules skipped due to selector errors' - Reddit
... error when running ssr: 2 rules skipped due to selector errors: legend+* -> Cannot read properties of undefined (reading 'type').
Read more >
legend * -> cannot read properties of undefined (reading 'type')
This error occurs when attempting to read a property of an undefined variable. It typically means that the variable in question has not...
Read more >
MDB4 with Angular12 css skipped rules
8 rules skipped due to selector errors: ... Topic: MDB4 with Angular12 css skipped rules ... Cannot read properties of undefined (reading 'type') ......
Read more >
Problem running Build command: npm run prerender - Support
11:48:03 PM: 2 rules skipped due to selector errors: 11:48:03 PM: legend+* -> Cannot read properties of undefined (reading 'type') 11:48:03 PM: .table>>>* ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found