fix GitHub import endpoint#504
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
👋 Thanks for opening a PR, @saurabhhhcodes!Your PR has entered the 🚦 PR Review Pipeline.
What happens next
A pipeline status comment will appear below and update automatically as your PR progresses. While you wait
This comment is posted only once. |
What changed
POST /api/github/importendpoint that imports public GitHub repos into a new playground.Unexpected token <JSON parse error when the endpoint returns HTML or another non-JSON response.Why
The import dialog was calling
/api/github/import, but no route existed, so the browser was trying to parse the HTML 404 page as JSON.Closes #223
Validation
npx vitest run app/api/github/import/utils.test.tsnpx eslint app/api/github/import/route.ts app/api/github/import/utils.ts modules/dashboard/components/github-import-dialog.tsxgit diff --check