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.

Parcel with gh-pages

See original GitHub issue

🐛 bug report

🎛 Configuration (.babelrc, package.json, cli command)

{
  "name": "parcel-react-example",
  "license": "MIT",
  "scripts": {
    "start": "cross-env NODE_ENV=development parcel index.html ",
    "build": "cross-env NODE_ENV=production parcel build index.html --public-url ./",
    "predeploy": "yarn build",
    "deploy": "gh-pages -d dist"
  },
  "homepage": "http://stychu.github.io/testAldente",
  "dependencies": {
    "autoprefixer": "^7.2.1",
    "babel-preset-react-app": "^3.1.0",
    "gh-pages": "^1.1.0",
    "parcel-bundler": "^1.4.1",
    "react": "^16.2.0",
    "react-dom": "^16.2.0"
  },
  "postcss": {
    "modules": false,
    "plugins": {
      "autoprefixer": {
        "browsers": [
          ">1%",
          "last 4 versions",
          "Firefox ESR",
          "not ie < 9"
        ],
        "flexbox": "no-2009"
      }
    }
  },
  "devDependencies": {
    "cross-env": "^5.1.1"
  }
}

{
  "presets": ["react-app"]
}

🤔 Expected Behavior

Basically, I wanted to publish simple react app to the GitHub pages with a usage of a parcel. Unfortunately, each time I try, app doesn’t get published. I mean it does get published correctly to the repo and gh-pages branch but I can’t see the app on homepage screen. I can’t find a solution to this. Im not sure if this is related strictly to the parcel build or I did something wrong… After running parcel build I can open my index.html from /dist and the app is working fine so it should work also on the gh-pages but it doesn’t… When I try this with the react-app-cli which is using webpack everything works just fine.

😯 Current Behavior

App doesn’t update/run correctly after publishing to gh-pages.

💁 Possible Solution


🔦 Context

I want working app on gh-pages that is build with a parcel.

🌍 Your Environment

Software Version(s)
Parcel 1.4.1
Node v6.10.0
npm/Yarn 5.3.0/1.1.0
Operating System Linux

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:13

github_iconTop GitHub Comments

9reactions
seifsgcommented, Jan 8, 2018

@stychu I’ve looked into your repo at https://github.com/stychu/testAldente/tree/gh-pages Please check the settings that this branch ‘gh-pages’ is the one for github pages to serve from. Then try again with parcel build index.html --public-url /testAldente/ I hope it works.

7reactions
seifsgcommented, Jan 8, 2018

@stychu sorry that was just an example brought from the official Parcel website. Looking further on what you posted, I think the argument for the public-url option should be something like http://stychu.github.io/testAldente/

Please try this: parcel build index.html --public-url http://stychu.github.io/testAldente/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building and publishing a web app @ github pages using ...
Building and publishing a web app @ github pages using ParcelJS ... You may want to employ the Parcel backed boilerplate that implements...
Read more >
How to... host a site using Github Pages and Parcel
When you start messing around, it's very nice to have a free and good hosting service that you can use directly from your...
Read more >
Deploying React app with Parcel build on Github Pages
I am trying to deploy a React app with Parcel on Github Pages. I have deployed it but the app ...
Read more >
Use Parcel to Bundle a Hyperapp App & Deploy to GitHub ...
Daz shows how easy it is to use Parcel — a module bundler — to build a static JS site and automatically deploy...
Read more >
Deploying and building React projects to GitHub Pages with ...
For my private mini-projects, I prefer to use Parcel bundler over Create React App just because there... Tagged with engineeringmonday ...
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