Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Deploy Github Pages with All node_modules #76

Closed
jkaw opened this issue Feb 20, 2023 · 14 comments
Closed

Can't Deploy Github Pages with All node_modules #76

jkaw opened this issue Feb 20, 2023 · 14 comments

Comments

@jkaw
Copy link

jkaw commented Feb 20, 2023

Github pages will fail if you try to deploy with all of the node modules currently in your repo.
Remove all but the necessary ones in the package.json
"animate.css": "^3.7.2",
"font-awesome": "^4.7.0",
"waypoints": "^4.0.1"

and the gulp related ones for development. But you probably should put some gulp info in the README as well so people know how to minimize/compile the js and sass files.

@sachinjogi
Copy link

@jkaw were you able to fix it? If yes, can you upload the package.json

@jkaw
Copy link
Author

jkaw commented Feb 24, 2023

@sachinjogi the package json is correct. You just need to delete all folders in the node_modules folder except for the ones I listed from your fork.

In your local you might want to keep the gulp related ones if you plan on changing any js/css as those will need to be minimized.

@sachinjogi
Copy link

Right, actually it wasn't the issue with the package.json, author had pushed node modules to the repo which had some erroneous files. I jusr reverted it to an older commit and it fixed it.

@rampatra
Copy link
Owner

rampatra commented Feb 24, 2023

@sachinjogi I recently updated older dependency versions to their latest ones. This shouldn't give you any issues. Make sure you run: npm install and gulp.

@jkaw
Copy link
Author

jkaw commented Feb 27, 2023

@rampatra can you remove the extra node folders from your master? It will prevent this from being able to deploy on pages otherwise. You can change the README to run the npm commands. Even your github pages deploy action failed with the latest commit.

@rampatra
Copy link
Owner

@jkaw it's deleted now. Users have to do npm install before running the website from now on.

@jkaw
Copy link
Author

jkaw commented Feb 28, 2023

@rampatra if you delete the entire folder, you will lose a few node js libraries that the site needs to function properly. Check wedding.rampatra.com to see whats broken on your demo now. You need to keep the three folders I mentioned.

@rampatra
Copy link
Owner

@jkaw I do not understand. Why doesn't it work on github pages? Locally, this works fine. npm install command downloads all dependencies including the three that you have listed here and I see no issue.

@rampatra rampatra reopened this Feb 28, 2023
@rampatra
Copy link
Owner

rampatra commented Mar 1, 2023

I tried even defining my own custom workflow file with build commands but still no luck.

Here is the workflow file for reference: https://github.com/rampatra/wedding-website/actions/runs/4298555939/workflow

@jkaw
Copy link
Author

jkaw commented Mar 1, 2023

The problem is that the node_modules folder has too many unnecessary folders. The only ones you need for the website to function properly are:
animate.css
font-awesome
waypoints

The rest of them are not needed for the website to run. The extras that were in the node_modules folder caused the deployment tar to exceed the size limit for github pages. I will submit a merge request to restore things and you can take a look.

@jkaw
Copy link
Author

jkaw commented Mar 1, 2023

check pull request #77.

In my personal fork I did this and my github pages works.

@rampatra
Copy link
Owner

rampatra commented Mar 1, 2023

It is now fixed. I have gone with another approach (I think it's a bit cleaner than including node_modules folder). You can check out the latest index.html file.

Also, after seeing my recent changes carefully, I think my custom workflow (https://github.com/rampatra/wedding-website/actions/runs/4298555939/workflow) isn't complete. It did build fine but wasn't deploying the latest changes from master branch. If anyone has time to look into this new workflow thing then node_modules should work fine even on github pages. There won't be any issues because of the large size.

So, to conclude, as I couldn't find time to fix the workflow approach, I added a fallback mechanism in index.html, and therefore github pages now work fine.

@rampatra
Copy link
Owner

rampatra commented Mar 2, 2023

I updated my workflow file with deploy instructions but I am seeing other issues now - https://github.com/rampatra/wedding-website/blob/master/.github/workflows/npm-gulp.yml

I will have to debug it later. But for now, the fallback technique in index.html is fine to make the website work on github pages.

@rampatra rampatra closed this as completed Mar 2, 2023
@rampatra
Copy link
Owner

rampatra commented Mar 2, 2023

I have closed this issue as the website works fine on Gihub Pages and created a new ticket to fix Workflow - #78

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

No branches or pull requests

3 participants