Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code to make user access official Vercel deployment URL for non-production env is not reachable #2012

Open
mohitb35 opened this issue Mar 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mohitb35
Copy link
Collaborator

The following code's is intended to make users access the application from the official Vercel deployment URL for non-production environments

However, it is not reachable on the deployed build, and serves no purpose for local development. It should either be corrected (if needed), or removed.

// pages/_app.tsx
if (process.env.NODE_ENV !== 'production') {
    if (process.env.VERCEL_URL && typeof window !== 'undefined') {
      if (process.env.VERCEL_URL !== window.location.hostname) {
        router.replace(`https://${process.env.VERCEL_URL}`);
      }
    }
  }
@mohitb35 mohitb35 added the bug Something isn't working label Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant