TypeError: Cannot read property ‘offsetHeight’ of null

Hi everyone,

I’ve encountered a bug in my website and wondered if you could help.

I have a database for user submitted posts (where a site member can post and only the site member author can view/modify/delete). I then have a dynamic page to view each post and a separate dynamic page to edit each post. Only the site member author can access each of these dynamic pages. The edit post page is causing issues. There is a dynamic dataset for the post on the page and this is set to read/write; there are various user input fields and a submit button, which are all connected to the dataset. There is no custom JavaScript on this particular page.

When I view the site in the editor preview mode, all works as anticipated (screenshot below).

When I view the same page on the live site, the image and image upload button appear briefly and then are replaced with a ‘Go Home’ link (screenshot below).

The Chrome developer console reveals a load of the following errors: “ TypeError: Cannot read property ‘offsetHeight’ of null ” (screenshot below). The bug occurs in Chrome, Safari, and Edge; however, the bug doesn’t always occur, sometimes it works as intended.

Does anyone have any ideas on how to fix this? I’ve tried rebuilding the page from scratch, but to no avail.

Thanks,
JM

Did you sync your database collections?

Thanks for the suggestion Yisrael. I’ve tried deleting all of my live data and syncing the sandbox data, but I still receive the same errors as above. The dynamic page appears to be pulling data from the database, as half of the information shows and the other half flashes up briefly before disappearing.

You should also check your database permissions .

If you continue to have problems, please post the URL of your site. Only authorized Wix personnel can get access to your site in the editor. Please include the name of the page involved.

The permissions seem fine to me (all set to site member or site member author - and I’m logged into the correct site member author).

The site is: edited
The page causing difficulties is: UserItems Edit

Thanks for your help!

I cloned the site and then published my own version. When I changed the permission of the userItems collection to Anyone I was able to view the page. I believe that in order for the site visitor to view “their data”, they will need to be signed in.

You don’t have any code on this page and your issue is a database issue - and how to use it. This forum is dedicated to Corvid. For questions that are not related to code you can contact the Wix support team . You’ll get better help for your problem there.

Thanks for looking into it Yisrael. Even with open permissions, I receive the same errors. I’ll contact the Wix support team as you’ve suggested.