Skip to content

Instantly share code, notes, and snippets.

@erin-at-work
Last active September 16, 2019 14:54
Show Gist options
  • Save erin-at-work/9073d5fcd80b2a949601aba638246785 to your computer and use it in GitHub Desktop.
Save erin-at-work/9073d5fcd80b2a949601aba638246785 to your computer and use it in GitHub Desktop.
Nextjs-9-funky-town

containers/checkout-success/index.js:

    <Button arrow fullWidth onClick={() => Router.push(setupLink)} primary>
      Continue
    </Button>

containers/booking/reschedule.js:

                  <CancelLink
                    id="cancel-button"
                    onClick={this.handleCancelRequest}
                  >
                    Cancel appointment
                  </CancelLink>
                  
@handleCancelRequest:
    if (shouldRedirect) {
      Router.push(
        `https://s.candidco.com/flow/Cancellation/variant/main?appointment_token=${token}&appointment_id=${appointmentId}&studio_region=${studioRegion.slug}&studio_slug=${studioSlug}`
      );

      return;
    }

    Router.push({
      pathname: '/booking/cancel',
      query: { studioSlug, appointmentId, token },
    });

const CancelLink = styled.a

@erin-at-work
Copy link
Author

https://github.com/zeit/next.js/blob/master/errors/invalid-href-passed.md

Either you passed a non-internal href to a next/link component or you called Router#push or Router#replace with one.

Possible Ways to Fix It

Look for any usage of next/link or next/router that is being passed a non-internal href and replace them with either an anchor tag () or window.location.href = YOUR_HREF.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment