8000 propName.toLowerCase is not a function · Issue #46936 · angular/angular · GitHub
[go: up one dir, main page]

Skip to content
propName.toLowerCase is not a function #46936
Closed
@Will-at-FreedomDev

Description

@Will-at-FreedomDev

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

https://stackblitz.com/edit/angular-jyiqdv?file=src%2Fapp%2Fvalue-of.component.ts,src%2Fapp%2Fapp.module.ts,src%2Fapp%2Fautocomplete-filter-example.ts,src%2Fapp%2Fautocomplete-filter-example.css,src%2Fapp%2Fautocomplete-filter-example.html

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0