Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ohabash opened this issue Feb 21, 2022 · 4 comments
Closed

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

ohabash opened this issue Feb 21, 2022 · 4 comments

Comments

@ohabash
Copy link

ohabash commented Feb 21, 2022

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

@JoostK JoostK transferred this issue from angular/angular Feb 21, 2022
@alan-agius4
Copy link
Collaborator

Not sure what is happening here, although this is likely a rollup/acorn issue.

I suggest that you try to add a breakpoint / logs in the tryParse method.

@alan-agius4
Copy link
Collaborator

Closing as I doubt this is causing by the Angular CLI. Please feel free to re-open if you discover otherwise.

@ohabash
Copy link
Author

ohabash commented Feb 28, 2022

I was able to find a more detailed error. I will post my solution here if you are not able to help.
Screen Shot 2022-02-28 at 4 56 02 PM

here is how the talk with rollup is going.

rollup/rollup#3582

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants