Skip to content

Conversation

@aldoprogrammer
Copy link

Fix Next.js crash when BLOB_STORE_ID is missing

Summary

Fixes a Next.js startup crash caused by an invalid images.remotePatterns entry
when BLOB_STORE_ID is not defined.

Context

On a clean setup, next.config.js always added an image remote pattern using
process.env.BLOB_STORE_ID, resulting in an invalid hostname and causing
Next.js strict config validation to fail.

This issue was previously reported in #417,
where the suggested workaround was to manually define a dummy BLOB_STORE_ID.

Changes

  • Conditionally include the BLOB_STORE_ID image host only when the env variable is defined
  • Prevents invalid remotePatterns entries on fresh installs

Testing

  • pnpm dev without BLOB_STORE_ID
  • pnpm dev with BLOB_STORE_ID set
  • pnpm build

Related

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.

Invalid images.remotePatterns entry crashes next dev

1 participant