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

Angular 19 component import broken #1659

Open
1 task done
ilyakonrad opened this issue Dec 9, 2024 · 1 comment
Open
1 task done

Angular 19 component import broken #1659

ilyakonrad opened this issue Dec 9, 2024 · 1 comment

Comments

@ilyakonrad
Copy link

Describe the bug

Impossible to import components. Adding import statement anywhere results in Angular compilation initialization failed. CLI error on the page and Error: Digest method not supported error in the console.

Link to the blitz that caused the error

https://stackblitz.com/edit/stackblitz-starters-397me8uu?file=src%2Froutes.ts

Steps to reproduce

  1. Comment out the import on line 9 in routes.ts (import { ToggleableComponent } from './toggleable.component').
  2. See the build completing successfully.
  3. Revert the change.
  4. See the error again.

Expected behavior

There shouldn't be any error.

Parity with Local

Screenshots

image

Platform

  • OS: Windows
  • Browser: Chrome
  • Version: 131.0.6778.109

Additional context

No response

@torsten-bit
Copy link

torsten-bit commented Dec 12, 2024

I found an even simpler example, which produces this bug (https://stackblitz.com/edit/stackblitz-starters-gyh541gn). It is a vanilla angular-project (as of 12.12.2024). And I just added a styles-property to the component-decorator. As soon as the rule contains some CSS-rule, the error occurs. Without the rule everything compiles just fine. Therefore I guess it has something to do with the parsing of the style-rules.

This might have to do with the new @angular/build dev-dependency. When I install the previously used @angular-devkit/build-angular dependency and adjust the angular.json-builders accordingly, the bug vanishes (see: https://stackblitz.com/edit/stackblitz-starters-wnkoqjvo?file=src%2Fmain.ts).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants