Repository navigation
Closed
Labels
area: compilerIssues related to `ngc`, Angular's template compilerIssues related to `ngc`, Angular's template compilerbugstate: has PR
Milestone
Description
Which @angular/* package(s) are the source of the bug?
compiler
Is this a regression?
No
Description
I think I've narrowed down the reason for this error. I created an @Input() binding with the name valueOf. I think the angular compiler doesn't like this name for some reason, but I can't find any documentation on this being the case. I forked one of the Angular Material examples and updated the example a bit to demonstrate the error.
@Component({
selector: 'app-value-of',
template: '{{valueOf("abc")}}'
})
export class ValueOfComponent {
@Input() valueOf: (s: string) => any = (s: string) => s;
}
@Component({
selector: 'autocomplete-filter-example',
template: '<app-value-of [valueOf]="myValueOf"></app-value-of>',
})
export class AutocompleteFilterExample {
myValueOf = (s: string) => 'something else';
}Please provide a link to a minimal reproduction of the bug
Please provide the exception or error you saw
./src/main.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: propName.toLowerCase is not a function
at eval (/home/projects/angular-jyiqdv/node_modules/@ngtools/webpack/src/ivy/loader.js:81:18)
./src/polyfills.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: propName.toLowerCase is not a function
at eval (/home/projects/angular-jyiqdv/node_modules/@ngtools/webpack/src/ivy/loader.js:81:18)
Please provide the environment you discovered this bug in (run ng version)
This information can be found in the stackblitz reproduction. Looks like version 14.
Anything else?
No response
Reacted by Mustafa M. Gamal
Metadata
Metadata
Assignees
Labels
area: compilerIssues related to `ngc`, Angular's template compilerIssues related to `ngc`, Angular's template compilerbugstate: has PR
Activity
alan-agius4 commentedon Jul 22, 2022
@alxhub, this seems to be caused by the compiler.
[-]propName.toLowerCase is not a function in node_modules/@ngtools/webpack/ivy/loader.js[/-][+]propName.toLowerCase is not a function[/+]noobyogi0010 commentedon Jul 22, 2022
Hey, @alan-agius4
I would like to work on this issue if no one else has already taken it up.
Thanks!
alan-agius4 commentedon Jul 22, 2022
@noobyogi0010 go for it.
noobyogi0010 commentedon Jul 25, 2022
Okay, thanks!
@alan-agius4
fix(compiler): avoid errors for inputs with Object-builtin names (#47220
angular-automatic-lock-bot commentedon Oct 7, 2022
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.