Skip to content

Lambda not supported for AOT  #26080

@Sjerd

Description

@Sjerd

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:

Current behavior

Write a custom validator per docs: https://angular.io/guide/form-validation and try to build with --prod flag for AOT compiler

Expected behavior

Be able to built with AOT without build error:

BUILD ERROR
: Error: /home/test/src/validators/generic.validator.ts:17:1: Error encountered in metadata generated for exported symbol 'GenericValidator':
/home/test/src/validators/generic.validator.ts:40:12: Metadata collected contains an error that will be reported at runtime: Lambda not supported.
 {"__symbolic":"error","message":"Lambda not supported","line":39,"character":11}

Minimal reproduction of the problem with instructions

Download:
https://stackblitz.com/edit/angular-gitter-tsgzld
And built with npm i && ng build --prod

What is the motivation / use case for changing the behavior?

Following the instructions from the official docs triggers a build error.
https://angular.io/guide/aot-compiler
https://angular.io/guide/form-validation

Environment


Angular version: 5.2.11

 
For Tooling issues:
- Node version: v10.10.0
- Platform:  Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions