Vetur: Optional Chaning does not work on template

Created on 2 Nov 2020  路  2Comments  路  Source: vuejs/vetur

  • [x] I have searched through existing issues
  • [x] I have read through docs
  • [x] I have read FAQ
  • [x] I have tried restarting VS Code or running Vetur: Restart VLS

Info

  • Platform: Windows 10
  • Vetur version: 0.28.0
  • VS Code version: 1.50.1

Problem

I'm using Vue 3 and when I use optional chaning in template it shows a error saying "object is possibly 'null' or 'udefined' ". I think it should not show the error because when I use null coalescing operator, no error is shown.

Error Message: "Object is possibly 'null' or 'undefined'.Vetur(2533)"

image

bug template-interpolation

Most helpful comment

Although you didn't provide enough information.
It just so happens that I've had the same problem.
But in the past, Vue2 didn't allow it.
So I choose to ignore it, that's all.

I create a PR to fix it.
Please provide a repro case for the next time in issue.

All 2 comments

Your issue is closed because you did not provide a repro case. Please read https://github.com/vuejs/vetur/blob/master/.github/NO_REPRO_CASE.md and open a new issue or reopen this one.

Although you didn't provide enough information.
It just so happens that I've had the same problem.
But in the past, Vue2 didn't allow it.
So I choose to ignore it, that's all.

I create a PR to fix it.
Please provide a repro case for the next time in issue.

Was this page helpful?
0 / 5 - 0 ratings