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

fix crash when cloning locally #303

Merged
merged 1 commit into from
Apr 6, 2024
Merged

fix crash when cloning locally #303

merged 1 commit into from
Apr 6, 2024

Conversation

dferber90
Copy link
Contributor

@dferber90 dferber90 commented Apr 6, 2024

The template crashes when cloning, even after vc env pull, since VERCEL_URL is set to an empty string when pulling env var.

  1. Deploy https://vercel.com/templates/next.js/nextjs-ai-chatbot
  2. Clone the repo locally
  3. vc link
  4. vc env pull
  5. pnpm i
  6. pnpm dev
image

Copy link

vercel bot commented Apr 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ai-chatbot-rces ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 6, 2024 4:56pm

@@ -9,7 +9,9 @@ import { Header } from '@/components/header'
import { Toaster } from '@/components/ui/sonner'

export const metadata = {
metadataBase: new URL(`https://${process.env.VERCEL_URL}`),
metadataBase: process.env.VERCEL_URL
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if we can just remove this option altogether, as the default behavior seems to be exactly what we want.

https://nextjs.org/docs/app/api-reference/functions/generate-metadata#default-value

When VERCEL_URL is detected: https://${process.env.VERCEL_URL} otherwise it falls back to http://localhost:${process.env.PORT || 3000}.

@jaredpalmer jaredpalmer merged commit 79ee9e4 into main Apr 6, 2024
3 checks passed
@iteratetograceness iteratetograceness deleted the dferber90-patch-1 branch May 21, 2024 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants