laravelnews / site-bugs

5 stars 0 forks source link

Search text box javascript error. #26

Closed vaweto closed 11 months ago

vaweto commented 11 months ago

While writing on search box i'am getting an Uncaught (in promise) TypeError: Cannot read properties of null (reading 'length').

This is from search widget on that code ${t.excerpt.length > 150 ? t.excerpt.substring(0, 150) + "..." : t.excerpt}

ericlbarnes commented 11 months ago

That's odd, and I'm not duplicating with safari or brave. What browser are you using?

vaweto commented 11 months ago

From M1 macbook with Version 116.0.5845.179 of chrome and from a mobile version of chrome

Untitled 3

ericlbarnes commented 11 months ago

That was weird. I did duplicate it in chrome. I just did a rebuild of the assets and I think it's fixed now. Might need to do a hard refresh "just incase".

vaweto commented 11 months ago

I think I found the problem. The error happened when you search for something that does not exist. So the excerpt is empty because it returns nothing.

ericlbarnes commented 11 months ago

Thanks! Updated now. Can you try again?

vaweto commented 11 months ago

It's all good now!!

ericlbarnes commented 11 months ago

🎉