Repository navigation
Language service CopySourceToTcb generates duplicate i0 imports, causing false signal-input errors in generic components #71547
Copy link
Copy link
Open
Labels
P4A relatively minor issue that is not relevant to core functionsA relatively minor issue that is not relevant to core functionsarea: language-serviceIssues related to Angular's VS Code language serviceIssues related to Angular's VS Code language serviceopen for contributionsAn issue that is suitable for a community contributor (based on its complexity/scope).An issue that is suitable for a community contributor (based on its complexity/scope).
Milestone
Description
Is this a bug report or a feature request?
- Bug Report
- Feature Request
Please provide the steps to reproduce the issue [Bug Report only]
- Clone https://github.com/VictorHumanist/CopySourceToTcbBug
- Run
npm install. - Run
npm run build; the Angular CLI build succeeds. - Open this folder by itself in VS Code with Angular Language Service 22.2.0 enabled.
- Open
src/app/copy-source-to-tcb-repro.component.html. - Observe false
ngtsc(2339)andngtsc(7053)errors on the signal-input bindings. If errors don't show up immediately, edit the file, e.g. add empty line. - Put the cursor in
busy()and run Angular: View Template Typecheck Block.
The generated TCB copies the generic component source and produces colliding namespace imports similar to:
import * as i0 from '@fundamental-ngx/ui5-webcomponents/utils'
// ...
import * as i0 from '@angular/core';The first import is needed for the GenericControlValueAccessor host directive on MultiComboBox. The second is the preparation import for signal-input checking. As a result, i0.ɵINPUT_SIGNAL_BRAND_WRITE_TYPE can be resolved against the Fundamental NGX utility module instead of @angular/core.
The trigger consists of:
- a generic component with a non-exported generic constraint, forcing copied-source inline type checking;
- an external component with a host directive, forcing a generated external import; and
- transformed signal inputs, forcing the Angular-core signal write-brand import.
There is also a second defect: imports inserted at position zero are concatenated without separators:
import * as i0 from '@fundamental-ngx/ui5-webcomponents/utils'import { Component, input, ɵINPUT_SIGNAL_BRAND_WRITE_TYPE } from "@angular/core";Please provide the expected behavior vs the actual behavior you encountered [Bug Report only]
Expected behavior: no errors should be visible
Actual behavior: false ngtsc(2339) and ngtsc(7053) errors on the signal-input bindings
Please provide a screenshot if possible [Bug Report only]
Please provide the exception or error you saw [Bug Report only]
Element implicitly has an 'any' type because expression of type 'any' can't be used to index type 'InputSignalWithTransform<boolean, unknown>'.ngtsc(7053)
copy-source-to-tcb-repro.component.ngtypecheck.ts(13, 18): Error occurs in the template of component CopySourceToTcbReproComponent.
Property 'ɵINPUT_SIGNAL_BRAND_WRITE_TYPE' does not exist on type 'typeof import("c:/Users/Admin/source/repos/CopySourceToTcbBug/node_modules/@fundamental-ngx/ui5-webcomponents/types/fundamental-ngx-ui5-webcomponents-utils")'.ngtsc(2339)
copy-source-to-tcb-repro.component.ngtypecheck.ts(13, 18): Error occurs in the template of component CopySourceToTcbReproComponent.
Element implicitly has an 'any' type because expression of type 'any' can't be used to index type 'InputSignalWithTransform<boolean, unknown>'.ngtsc(7053)
copy-source-to-tcb-repro.component.ngtypecheck.ngtypecheck.ts(13, 18): Error occurs in the template of component CopySourceToTcbReproComponent.
Property 'ɵINPUT_SIGNAL_BRAND_WRITE_TYPE' does not exist on type 'typeof import("c:/Users/Admin/source/repos/CopySourceToTcbBug/node_modules/@fundamental-ngx/ui5-webcomponents/types/fundamental-ngx-ui5-webcomponents-utils")'.ngtsc(2339)
copy-source-to-tcb-repro.component.ngtypecheck.ngtypecheck.ts(13, 18): Error occurs in the template of component CopySourceToTcbReproComponent.
Element implicitly has an 'any' type because expression of type 'any' can't be used to index type 'InputSignalWithTransform<boolean, unknown>'.ngtsc(7053)
copy-source-to-tcb-repro.component.ngtypecheck.ngtypecheck.ts(13, 18): Error occurs in the template of component CopySourceToTcbReproComponent.
Property 'ɵINPUT_SIGNAL_BRAND_WRITE_TYPE' does not exist on type 'typeof import("c:/Users/Admin/source/repos/CopySourceToTcbBug/node_modules/@fundamental-ngx/ui5-webcomponents/types/fundamental-ngx-ui5-webcomponents-utils")'.ngtsc(2339)
copy-source-to-tcb-repro.component.ngtypecheck.ngtypecheck.ts(13, 18): Error occurs in the template of component CopySourceToTcbReproComponent.
Element implicitly has an 'any' type because expression of type 'any' can't be used to index type 'InputSignalWithTransform<boolean, unknown>'.ngtsc(7053)
copy-source-to-tcb-repro.component.ngtypecheck.ngtypecheck.ts(13, 18): Error occurs in the template of component CopySourceToTcbReproComponent.
Property 'ɵINPUT_SIGNAL_BRAND_WRITE_TYPE' does not exist on type 'typeof import("c:/Users/Admin/source/repos/CopySourceToTcbBug/node_modules/@fundamental-ngx/ui5-webcomponents/types/fundamental-ngx-ui5-webcomponents-utils")'.ngtsc(2339)
copy-source-to-tcb-repro.component.ngtypecheck.ngtypecheck.ts(13, 18): Error occurs in the template of component CopySourceToTcbReproComponent.
Description [Feature Request only]
No response
Proposed solution [Feature Request only]
No response
Alternatives considered [Feature Request only]
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P4A relatively minor issue that is not relevant to core functionsA relatively minor issue that is not relevant to core functionsarea: language-serviceIssues related to Angular's VS Code language serviceIssues related to Angular's VS Code language serviceopen for contributionsAn issue that is suitable for a community contributor (based on its complexity/scope).An issue that is suitable for a community contributor (based on its complexity/scope).


Activity