-
Notifications
You must be signed in to change notification settings - Fork 602
Open
Description
Expected Behaviour
No errors if my navigation document is empty (yet).
I like my browser js console clean from framework errors :) But it's a minor issue.
Actual Behaviour
With an empty nav.docx (see below), I see this error in the js console (using localhost:3000 dev server):
failed to load module for header TypeError: Cannot read properties of null (reading 'querySelectorAll')
at toggleAllNavSections (header.js:44:12)
at toggleMenu (header.js:60:3)
at Module.decorate (header.js:138:5)
at async lib-franklin.js:360:15
This is because this line here does not check if sections is null nor not.
Empty nav.docx: The nav.plain.html seen in the browser looks like this:
<div></div>
Reproduce Scenario (including but not limited to)
Steps to Reproduce
- have an empty navigation doc (e.g. nav.docx)
- use default boilerplate code
- run hlx up
- open any page in localhost:3000
Platform and Version
boilerplate: https://github.com/adobe/helix-project-boilerplate/tree/a906cfc82b7a6f807e6a1899fa69a062ade2a0bc
franklin-simulator v14.20.0
Sample Code that illustrates the problem
Standard boilerplate code.
Logs taken while reproducing problem
Metadata
Metadata
Assignees
Labels
No labels