Skip to content

fix: handle invalid language routes - #2820

Open
lynnedogwo wants to merge 1 commit into
DeepSourceCorp:masterfrom
lynnedogwo:fix-frontend-bug
Open

lynnedogwo wants to merge 1 commit into
DeepSourceCorp:masterfrom
lynnedogwo:fix-frontend-bug

Conversation

@lynnedogwo

Copy link
Copy Markdown

What does this PR do?

Fixes an unhandled server error when a user visits a language route that does not exist.

Problem

When an invalid language slug is provided, Tags.find() returns undefined. The page then attempts to access tag.language, causing a TypeError and returning an HTTP 500 response.

Solution

Added a check to verify that the language tag exists. If no matching tag is found, the application now throws a Nuxt 404 error with the message "Language Not Found".

Testing

Verified locally:

  • /language/javascript returns HTTP 200 and renders correctly.
  • /language/nonexistent returns HTTP 404 instead of HTTP 500.
  • Nuxt renders the 404 error page correctly.
  • Prettier formatting was applied to the modified file.

AI Disclosure

AI assistance was used to investigate the codebase, identify the root cause, and assist with the implementation. The change was reviewed and tested locally before submission.

@vercel

vercel Bot commented Sep 20, 2026

Copy link
Copy Markdown

@lynnedogwo is attempting to deploy a commit to the DeepSource Team on Vercel.

A member of the Team first needs to authorize it.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant