Search code examples
reactjsgithubdeploymentgithub-pages

Why unable to deploy my website on github pages?


I have a React website which I am trying to deploy using GIthub pages. While following the steps to deploy my application Im getting the following error:

Failed to compile.

static/css/main.9a1ecd2c.css from Css Minimizer plugin
Error: Unexpected '/'. Escaping special characters with \ may help.

Steps I followed:

1)Creating a repo.

2)Linking local and remote repo

3)adding URL to my package.json file.

4)installing gh-pages

5)adding redeploy and deploy script as :

 "predeploy":"npm run build",
    "deploy":"gh-pages -d build",

6)running npm run deploy


Solution

  • OP, I'm not sure if you ever got this figured out, but I ran into a similar issue and mine was a bungled comment somewhere in a css file. It doesn't break when you run locally, but when you run it on github-pages it throws that error.

    Example: *My bungled Comment line*/ -> /*Corrected Comment line*/