I don’t like to see this error.
Symptoms:
- You can see the Page Layout menu in the edit page ribbon, but when you click it, nothing happens.
- Your browser tells you, “Uncaught TypeError: Cannot call method ‘parentElement’ of null .”
- If you’re debugging in your browser, you’re probably thinking, I’ll just go to the line where the error is and trace it from there. The entire JS file is a single line with meaningless shortened variable names, so that’s not much help.
The culprit is normally a bad page layout. The couple of times that I’ve seen this error, it’s somehow tied to content types. Some diagnostic questions to ask yourself:
- If you recently deployed a new page layout, is it tied to a content type that isn’t activated on your site?
- Have you changed any fields in a content type that’s turned on on the site, but the changes haven’t taken?
Sometimes deleting and re-deploying the page layouts helps to sync the page layout to the most current content type.
I have to say, I wanted to document this problem and spell out an exact solution, but as you can see I don’t have an exact solution. Does anyone else out there have a more robust strategy for dealing with this issue?