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

Inaccurate error message on step 2 of the tutorial #45759

Closed
jdob opened this issue Apr 25, 2022 · 2 comments
Closed

Inaccurate error message on step 2 of the tutorial #45759

jdob opened this issue Apr 25, 2022 · 2 comments
Milestone

Comments

@jdob
Copy link

jdob commented Apr 25, 2022

Description

Following the tutorial step 2, it has me add a details section and specifies that the application is broken. That part is right, it is broken. But instead of the documented:

HeroesComponent.html:3 ERROR TypeError: Cannot read property 'name' of undefined

Instead I get:

Error: src/app/heroes/heroes.component.html:11:25 - error TS2532: Object is possibly 'undefined'.

Also note that the file mentioned in the documented error message doesn't exist. The rest of the tutorial correctly referenced heroes.component.html, but the documented error shows HeroesComponent.html. I'm guessing that's from an older version of Angular and just got missed when the other pieces were being updated.

What is the affected URL?

https://angular.io/tutorial/toh-pt2#add-a-details-section

Please provide the steps to reproduce the issue

Follow the tutorial through "Add a details section"

Please provide the expected behavior vs the actual behavior you encountered

Mentioned in the description; the expected behavior is one error message, but in practice I see a different one.

Please provide a screenshot if possible

No response

Please provide the exception or error you saw

Error: src/app/heroes/heroes.component.html:14:51 - error TS2532: Object is possibly 'undefined'.

Is this a browser-specific issue? If so, please specify the device, browser, and version.

No response

@ngbot ngbot bot added this to the needsTriage milestone Apr 25, 2022
dario-piotrowicz added a commit to dario-piotrowicz/angular that referenced this issue May 4, 2022
the second step of the tour of heroes refers to a runtime error which
generally isn't presented to new users since it gets caught by the
TypeScript compiler's strict mode, clarify such detail so not to confuse
readers

resolves angular#45759
@dario-piotrowicz
Copy link
Contributor

Thanks @jdob good catch, I've opened a PR for clarifying that section 🙂👍

dario-piotrowicz added a commit to dario-piotrowicz/angular that referenced this issue May 4, 2022
the second step of the tour of heroes refers to a runtime error which
generally isn't presented to new users since it gets caught by the
TypeScript compiler's strict mode, clarify such detail so not to confuse
readers

resolves angular#45759
dario-piotrowicz added a commit to dario-piotrowicz/angular that referenced this issue May 5, 2022
the second step of the tour of heroes refers to a runtime error which
generally isn't presented to new users since it gets caught by the
TypeScript compiler's strict mode, clarify such detail so not to confuse
readers

resolves angular#45759
AndrewKushnir pushed a commit to dario-piotrowicz/angular that referenced this issue May 7, 2022
the second step of the tour of heroes refers to a runtime error which
generally isn't presented to new users since it gets caught by the
TypeScript compiler's strict mode, clarify such detail so not to confuse
readers

resolves angular#45759
AndrewKushnir pushed a commit that referenced this issue May 9, 2022
the second step of the tour of heroes refers to a runtime error which
generally isn't presented to new users since it gets caught by the
TypeScript compiler's strict mode, clarify such detail so not to confuse
readers

resolves #45759

PR Close #45878
AndrewKushnir pushed a commit that referenced this issue May 9, 2022
the second step of the tour of heroes refers to a runtime error which
generally isn't presented to new users since it gets caught by the
TypeScript compiler's strict mode, clarify such detail so not to confuse
readers

resolves #45759

PR Close #45878
@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 Jun 9, 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

Successfully merging a pull request may close this issue.

3 participants