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

Compilation errors in Angular 17 #736

Closed
GCHQDeveloper1138 opened this issue Dec 19, 2023 · 2 comments
Closed

Compilation errors in Angular 17 #736

GCHQDeveloper1138 opened this issue Dec 19, 2023 · 2 comments
Labels
type: bug 🐛 An unexpected problem or unintended behaviour

Comments

@GCHQDeveloper1138
Copy link

Summary of the bug

When used with Angular 17, ICDS types file cannot be compiled due to a conflict of properties due to multiple inheritance (see error below)

The app will not compile as a result

🪜 How to reproduce

Starting with an Angular 17 application, follow the instructions here: https://design.sis.gov.uk/get-started/install-components/angular

(Note that for an app with standalone components, the CUSTOM_ELEMENTS_SCHEMA will need to be added to components, not the module)

run 'ng serve' to serve the app and the error should occur

📸 Screenshots or code

Error is as follows:

⠧ Building...✘ [ERROR] TS2320: Interface 'HTMLIcTextFieldElement' cannot simultaneously extend types 'IcTextField' and 'HTMLStencilElement'.
  Named property 'ariaExpanded' of types 'IcTextField' and 'HTMLStencilElement' are not identical. [plugin angular-compiler]

    node_modules/@ukic/web-components/dist/types/components.d.ts:2659:14:
      2659 │     interface HTMLIcTextFieldElement extends Components.IcTextFi...
           ╵               ~~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] TS2320: Interface 'HTMLIcTextFieldElement' cannot simultaneously extend types 'IcTextField' and 'HTMLStencilElement'.
  Named property 'role' of types 'IcTextField' and 'HTMLStencilElement' are not identical. [plugin angular-compiler]

    node_modules/@ukic/web-components/dist/types/components.d.ts:2659:14:
      2659 │     interface HTMLIcTextFieldElement extends Components.IcTextFi...
           ╵               ~~~~~~~~~~~~~~~~~~~~~~

🖥 📱 Device

  • Type: Desktop
  • Device: Macbook
  • OS version: MacOS Sonoma 14.2
  • Browser version: N/A
  • Angular version: 17

🧐 Expected behaviour

The app should compile without the error

📝 Acceptance Criteria

If relevant, describe in full detail the different interactions and edge cases that the component or patterns needs to fulfil.

Given
When
Then

Additional info

I did a bit of Googling and found a similar error afflicting other projects. It can be worked around by turning off some TypeScript features, and may be related to stricter compilation rules in TypeScript >= 4.4.3 (see ionic-team/ionicons#1011 and ionic-team/ionicons#1007)

@GCHQDeveloper1138 GCHQDeveloper1138 added the type: bug 🐛 An unexpected problem or unintended behaviour label Dec 19, 2023
Copy link

Welcome 👋

Welcome to the ic-design-system repo, thank you for raising an issue!

How to contribute

Please read our CONTRIBUTING.md, which explains our ways of working and guidelines for contributions.

Code of Conduct

We'd appreciate it if you could read and abide by our Code of Conduct, as we wish to foster an inclusive and respectful community.

@GCHQ-Developer-847
Copy link
Contributor

The solution for this has been found - I have created a ticket to get it added to the Angular instructions on the ICDS website: #737.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 An unexpected problem or unintended behaviour
Projects
Development

No branches or pull requests

2 participants