I was receiving the same errors.
I believe the problem is when you are trying to initialize Flexbox on a div that is hidden within a parent div (I would assume your "thinkbox") is initially "hidden"). The outerWidth() function WORKS on a hidden div, but not when
the div is hidden by a parent object. Read here:
What I did was hide my parent div AFTER initializing my Flexbox. It's not optimal (the user sees the screen before I want them to), but it works for now. I could probably do something where I initialize the Flexbox when the div is actually "supposed"
to display, but then I would want to write some code than knows when the form initially displayed rather than subsequent displays so that I wasn't constantly initializing the Flexbox (actually, maybe repeat initiallizations wouldn't bee tooo expensive?).
Anyway, hopefully this answers your question...