question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hosting on GitHub Pages

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

I can host a Next.js app on a GitHub Pages.

Current Behavior

As far as I have digged into the issue, we can’t host a Next.js app on a GitHub Pages because of the location of the hosting: http://username.github.io/project-name/. It would be working perfectly if we hadhttp://project-name.github.io/.

Steps to Reproduce (for bugs)

Humm. I’m not sure it’s relevant. I can provide something if it help. I noticed the issue with http://oliviertassinari.github.io/react-swipeable-views/.

Context

Deploying a Next.js app into GitHub Pages guide is misleading. It’s not possible as far as I know.

Your Environment

Tech Version
next 4.1.4

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:48 (26 by maintainers)

github_iconTop GitHub Comments

31reactions
hipstersmoothiecommented, Oct 25, 2018

I’ve pubished an article that includes steps on how to push to github pages. This might also be helpful for some.

11reactions
thierryccommented, Dec 3, 2017

Eureka ! 🛁 @sergiodxa @oliviertassinari @jabacchetta

👍 use:

<Link href={ '/ap-grid-layout' } as={ process.env.BACKEND_URL + '/ap-grid-layout' }><a>Grid Layout</a></Link>

env-config.js

const prod = process.env.NODE_ENV === 'production'

module.exports = {   'process.env.BACKEND_URL': prod? '/Next-React-Components' : '' }

This solution works for me ! https://anotherplanet-io.github.io/Next-React-Components/

Do you confirm ? Refresh 👍 or 👎

Read more comments on GitHub >

github_iconTop Results From Across the Web

GitHub Pages | Websites for you and your projects, hosted ...
Head over to GitHub and create a new public repository named username.github.io, where username is your username (or organization name) on GitHub. If...
Read more >
Basic steps for hosting on Github
Steps for Hosting a Website on GitHub · Create a GitHub account on github.com. · Download either GitHub for Mac or GitHub for...
Read more >
Hosting your website on Github
Hosting your website on Github ... Github is a company that hosts "code repositories", collections of code for projects. Many of the code...
Read more >
How to host your first site for free on GitHub Pages
After you create and store HTML in a repository, navigate to the settings tab for that repository. · Click Pages on the left...
Read more >
Using GitHub to host a free static website
host our website, without paying anything at all, using GitHub Pages. · Step 1: Create/ Sign into your GitHub account. · Step 2...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found