Hey Meteor forum,
I’m neck deep in a weird bug over here. I recently deployed this site www.touchstonepc.com to galaxy. You can reproduce the bug by clicking “save me money” or “make me money” on the landing page and clicking the browser’s back button, then this error gets thrown. Disclaimer: this does not happen locally.
Update: I replaced flow-router with ostrio:flow-router-extra
because it leverages updated dependencies, and the error is now a little more descriptive.
Uncaught TypeError: Cannot read property 'replace' of undefined
What’s undefined is the route path. Before going to the target route the function replaces "/"
with "/the-target-path"
, but when clicking back the path is undefined
instead of "/"
.
Is there a way to explicity tell meteor that the target route path is “/”?
Some things to note:
- The back button works fine on every route except “shop insurance” and “signup”
- After going back to the
"/"
route withFlowRouter.go("/")
instead of clicking the browser back, the back button works fine, but it’s broken until that happens. - This bug happens with a user logged in and logged out
- The error only fires when going back to the
"/"
route - I cannot reproduce this locally using the
--production
flag when building - I have tried explicitly defining the ROOT_URL enviornment variable
Hopefully somebody can shed some light on this problem!
Thanks,
Dylan