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 and nullish coalescing not working anymore #17506

Closed
1 of 15 tasks
linjie997 opened this issue Apr 20, 2020 · 4 comments
Closed
1 of 15 tasks

Optional chaining and nullish coalescing not working anymore #17506

linjie997 opened this issue Apr 20, 2020 · 4 comments

Comments

@linjie997
Copy link

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Yes, the previous version in which this bug was not present was: 9.1.0

Description

After upgrading from 9.1.0 to 9.1.1, optional chaining and nullish coalescing are not working anymore.
At a first glance it looks like a downgrade of typescript version?

🔬 Minimal Reproduction

https://stackblitz.com/edit/angular-bt9hvm

🔥 Exception or Error



Error in src/app/app.component.ts (20:30)
Expression expected.

🌍 Your Environment



  "dependencies": {
    "@angular/animations": "^9.1.2",
    "@angular/common": "~9.1.2",
    "@angular/compiler": "~9.1.2",
    "@angular/core": "^9.1.2",
    "@angular/forms": "~9.1.2",
    "@angular/platform-browser": "~9.1.2",
    "@angular/platform-browser-dynamic": "~9.1.2",
    "@angular/router": "~9.1.2",
    "core-js": "^3.6.4",
    "rxjs": "~6.5.5",
    "tslib": "^1.10.0",
    "zone.js": "^0.10.3"
  },

  "devDependencies": {
    "@angular-devkit/build-angular": "~0.901.1",
    "@angular/cli": "^9.1.1",
    "@angular/compiler-cli": "~9.1.2",
    "@angular/language-service": "~9.1.2",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^12.11.1",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~3.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~3.7.5"
  }

Anything else relevant?
May related to #17320.

From my understanding, Angular still uses typescript 3.7+ (from this comment), so this should be working.

@alan-agius4
Copy link
Collaborator

Hi @linjie997, I download the StackBlitz project and tried to run locally. I wasn't able to reproduce the error.

Seems to me that StackBlitz might be using a TypeScript version which is different from the one specified in the package.json.

Mind opening an issue here: https://github.com/stackblitz/core/issues

Thanks.

@destus90
Copy link
Contributor

@linjie997
This rather looks like the StackBlitz issue stackblitz/core#483 (comment)

@linjie997
Copy link
Author

Hi, first of all thank you for your fast responses.
This was indeed a StackBlitz issue.

Second, I was facing the same issue locally on another project. At the end of the day, I deleted the whole project folder, fresh cloned from my git repository and it's working correctly. I guess there was something "dirty" with my node modules which caused this issue.

@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 May 21, 2020
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

3 participants