Skip to content

Conversation

@mwcz
Copy link
Contributor

@mwcz mwcz commented Jan 22, 2020

What has changed and why

pfe-navigation contained a reference to a variable that may not exist. The code was already doing some defensive checks of that kind, but one edge case was missed. This PR adds the edge case.

Uncaught (in promise) TypeError: Cannot read property 'length' of undefined

See commit 27aa87d to view that change.

I'm calling out the exact commit because this PR also runs prettier to format pfe-navigation which generated a lot of excess diffs. Somehow this element hasn't been formatted by the automatic formatter already.

Testing instructions

npm run build pfe-navigation

Open elements/pfe-navigation/demo/index.html, and comment out the <pfe-navigation-item> that has slot="search".

npm start

View the pfe-navigation demo page and confirm that the JS error is no longer in the console.

Ready-for-merge Checklist

  • Expected files: all files in this pull request are related to one feature request or issue (no stragglers)?
  • Did you update the CHANGELOG.md file with a summary of this update?

@mwcz mwcz requested a review from castastrophe January 22, 2020 20:51
@castastrophe
Copy link
Contributor

@mwcz There's a lot of formatting updates, can you help point me to the part of the code that is updated?

castastrophe
castastrophe previously approved these changes Jan 23, 2020
Copy link
Contributor

@castastrophe castastrophe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 One suggestion for the changelog since we know what the release tag would be.

@castastrophe
Copy link
Contributor

I tested the search and the language slots and neither throws the error anymore when commented out.

Co-Authored-By: [ Cassondra ] <castastrophe@users.noreply.github.com>
@castastrophe castastrophe merged commit 6a41811 into master Jan 24, 2020
@castastrophe castastrophe deleted the fix-nav-reference-error branch January 24, 2020 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants