Skip to content

Conversation

@ryofujimura
Copy link

Allows user to display their private repository code.
Needs:
Github Private access token
User can obtain private access token under https://github.com/settings/tokens.

@vercel
Copy link

vercel bot commented Mar 14, 2025

@ryofujimura is attempting to deploy a commit to the nuotsu Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Mar 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
github-iframe Error Error Nov 5, 2025 7:07pm

@nuotsu
Copy link
Owner

nuotsu commented Mar 14, 2025

@ryofujimura i thiiink there might be a minor security flaw here since it exposes the personal access token in the iframe src URL:

Screenshot 2025-03-13 at 6 27 48 PM

Also, for future commits, let's use Prettier formatter to keep code preferences consistent (.prettierrc).

Replace all occurrences of github-iframe.vercel.app with github-iframe-kappa.vercel.app in store.ts and README.md
- Update DOMAIN constant in store.ts to new Vercel deployment
- Update all example URLs in README.md
- All references now point to github-iframe-kappa.vercel.app
- Change Authorization header from 'token' to 'Bearer' format (correct GitHub API format)
- Use token immediately when provided (optimized for private repos)
- Improve error handling with clearer error messages
- Only fallback to raw URL for public repos (private repos can't use raw URLs)
- Add function to dynamically detect repository default branch
- Retry API call with explicit default branch if 404 occurs
- Use correct default branch in GitHub links (not hardcoded 'main')
- Improve 404 error messages with branch information
- Optimize branch detection to avoid duplicate API calls
@nuotsu
Copy link
Owner

nuotsu commented Nov 5, 2025

@ryofujimura Build error occurs
Screenshot 2025-11-05 at 11 07 51 AM

11:06:14.348
    ▲ Next.js 15.1.6
11:06:14.349
 
11:06:14.373
    Creating an optimized production build ...
11:06:26.916
  ✓ Compiled successfully
11:06:26.921
    Linting and checking validity of types ...
11:06:31.077
    Collecting page data ...
11:06:33.913
    Generating static pages (0/4) ...
11:06:34.768
    Generating static pages (1/4) 
11:06:34.769
    Generating static pages (2/4) 
11:06:34.769
    Generating static pages (3/4) 
11:06:34.769
 Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
11:06:34.769
 HttpError: Bad credentials - https://docs.github.com/rest
11:06:34.769
     at A (/vercel/path0/.next/server/app/(site)/page.js:17:36864)
11:06:34.769
     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
11:06:34.769
     at async eb (/vercel/path0/.next/server/app/(site)/page.js:18:83459)
11:06:34.769
     at async u.doExecute (/vercel/path0/.next/server/app/(site)/page.js:16:7931)
11:06:34.769
 Export encountered an error on /(site)/page: /, exiting the build.
11:06:34.773
  ⨯ Static worker exited with code: 1 and signal: null
11:06:34.809
 Error: Command "npm run build" exited with 1

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.

2 participants