Wait, you don't mean the literal values /page-name or /confirmation-page, right?
You mean it repeats the path of the confirmation page, whatever that is - so it should be /mythankyou but instead it's /mythankyou/mythankyou, if it’s supposed to be /otherthankyou it becomes /otherthankyou/otherthankyou, etc.
This is happening because your code has a bug that causes the visitor to be redirected
- first to the confirmation page
- then immediately to the confirmation page’s (nonexistent) confirmation page
This logic, packaged in this file, runs on the confirmation page as well as on the form page:
if (isKnownVisitor) {
window.localStorage.setItem('firstName', knownFirstName);
navigate(`thank-you?firstName=${knownFirstName}`);
} else {
window.localStorage.setItem('firstName', values.FirstName);
navigate(`thank-you?firstName=${values.FirstName}`);
}
If you look in Dev Tools » Network you can see there are two pages loaded in quick succession after a form submit. The second is the 404, /thank-you/thank-you.