Skip to content

"Optional chaining cannot appear in left-hand side" Suddenly appeared. #22743

@ohabash

Description

@ohabash

Which @angular/* package(s) are the source of the bug?

compiler-cli, compiler

Description

Suddenly my app will not build. I know what optional chaining is. and I tried looking for things in my code that were handled wrong but the app is large and I lack context to narrow the search down.

unfortunately i cannot pin point any code or change that has caused this error. The error is very vague and does not point out where in the code to debug. and may have been introduced when we updated ng and typescript all-though that is not confirmed.

Screen Shot 2022-02-21 at 12 13 59 PM

exception found during 'ng build'

✔ Compiling with Angular sources in Ivy partial compilation mode.
✖ Generating FESM2020
Optional chaining cannot appear in left-hand side (Note that you need plugins to import files that are not JavaScript)
[!] Error: unfinished hook action(s) on exit:
(node-resolve) resolveId "./cms.base" "/Users/omar/Sites/met-libs-nx/dist/libs/cms/esm2020/lib/shared/services/flamelink.service.mjs"
(node-resolve) resolveId "./db_paths" "/Users/omar/Sites/met-libs-nx/dist/libs/cms/esm2020/lib/shared/services/flamelink.service.mjs"
(node-resolve) resolveId "../shared/services/cms.service" "/Users/omar/Sites/met-libs-nx/dist/libs/cms/esm2020/lib/schema-panel/schema-builder.service.mjs"
(node-resolve) resolveId "../shared/services/flamelink.service" "/Users/omar/Sites/met-libs-nx/dist/libs/cms/esm2020/lib/schema-panel/schema-builder.service.mjs"
(node-resolve) resolveId "../shared/services/db_paths" "/Users/omar/Sites/met-libs-nx/dist/libs/cms/esm2020/lib/schema-panel/schema-builder.service.mjs"
...
Angular CLI: 13.2.4
Node: 14.16.0
Package Manager: npm 6.14.11
OS: darwin x64

Angular: 13.2.3
... animations, common, compiler, compiler-cli, core, forms
... language-service, material, platform-browser
... platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1302.4
@angular-devkit/build-angular   13.2.4
@angular-devkit/core            13.1.3
@angular-devkit/schematics      13.1.3
@angular/cli                    13.2.4
@angular/fire                   7.2.0
@schematics/angular             13.1.3
ng-packagr                      13.2.1
rxjs                            6.6.7
typescript                      4.5.5

anything helps

I am looking for any info that will assist me in debugging this issue. Please help! I will rewrite this question or provide any additional info but at the moment this is all the relevant info I have.

I used vscode regex search to find any ? before an = in the project but i did not find any. Are there tips similar to this that would help me narrow the hunt down?

(?.)[\d\D]+[=].

Do you think this is syntax error or a version number? Anything helps

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