Vite React App with Routes Deployed on Github | Reload error resolved!

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024
  • In this video, I will teach you how to deploy a Vite React App using React Router through GitHub Pages. In addition, I'll show you a simple and fast way to resolve the 404 error when reloading the page.
    📚 References
    GitHub Code (give it a star ⭐): github.com/Eri...
    Vite: vitejs.dev/
    React Router: reactrouter.com/
    🔔 Like and subscribe
    ⌚Time Stamps
    Deployment: 00:00
    Routing: 03:09
    Fixing Error: 6:14
    🎵 Musics
    Faixa: "Know Things"
    Música pela slip.stream
    Download gratuito / Stream: get.slip.strea...
    Faixa: "All Day We Dance", Mr. Milk
    Música pela slip.stream
    Download gratuito / Stream: get.slip.strea...
    Faixa: "Versions", Birdo
    Música pela slip.stream
    Download gratuito / Stream: get.slip.strea...
    Ouça no Spotify: go-stream.link...
    Faixa: "Omwow"
    Música pela slip.stream
    Download gratuito / Stream: get.slip.strea...

Комментарии • 85

  • @ek-developer
    @ek-developer  Год назад +2

    Guide demonstrating the step-by-step process and the codes used in the video within the repository's readme!

    • @kishan.0296
      @kishan.0296 11 месяцев назад +1

      help me, I am getting "unexpected application error 404 not found" when I open my github page after deployment.

    • @lovelynduru-magnus3233
      @lovelynduru-magnus3233 6 месяцев назад

      I got white screen and a console error saying loading module from my git page was blocked because of a disallowed MIME type (“text/html”). what should i do?

    • @kulinterests
      @kulinterests Месяц назад

      I am getting a white screen

  • @Skeeteism
    @Skeeteism Год назад +8

    God bless you for this vid, i've been questioning my life all day trying to fix 404 router error
    Thank you

  • @lazyjinchuriki1335
    @lazyjinchuriki1335 Год назад +3

    After an hour of creating and deleting repos. Finally a fix. THANK YOU.

    • @alephzero7808
      @alephzero7808 6 месяцев назад

      an hour?! It is nothing!I was strugling 2weeks!

  • @daniellelindblom7753
    @daniellelindblom7753 Месяц назад

    you absolutely saved my bacon with this one! thank you SO MUCH for taking the time to put this together!

  • @NikAfz
    @NikAfz Год назад +1

    Dear EK ,
    🙌 Thank you so much for your incredible video!
    I was stuck on a problem for hours until I found your video.
    Your explanations were clear, concise, and helped me find the solution I needed.
    Thank you, thank you, thank you!

  • @gabriel-dg2bd
    @gabriel-dg2bd 11 месяцев назад +1

    Thanks man!!! i saw multiples websites, but only seeing to believe, and your video helped me!!!

  • @aceade
    @aceade 7 месяцев назад +1

    This fixed two repos for me this morning. Filing this away for future reference!

  • @Zratey
    @Zratey Месяц назад

    If if this tutorial has 1 year and some minor things had changed, tysm for your guide. Thanks to you I could properly persue my project, I'll add a link to your Github guide within my README
    God bless you mate🙏

  • @nicolasgarin6794
    @nicolasgarin6794 6 месяцев назад +1

    I have a question, in my case I have an app that has dynamic url when you acces a specific element which id is at the final url.. how can I make it work if I have to specify each url at the route const declaration? Thank you in advance!

  • @mukulmayur7507
    @mukulmayur7507 17 дней назад

    Thanks brother for this information.

  • @paradise5534
    @paradise5534 Год назад +4

    Why does reloading the page cause a 404 error? I'm not sure if I understand exactly what the 404.html & code snippet you added to index.html do to correct this, could you explain it, if you know?

    • @ek-developer
      @ek-developer  Год назад +2

      It's been a while since I had researched this issue, but the error is something caused by GitHub's SSH. I'll research again to confirm it!

  • @CodeingWithManoj
    @CodeingWithManoj 4 месяца назад

    best video for vite react app with route deployment thanks bro

  • @everyellachannel
    @everyellachannel 2 месяца назад

    Many thanks from Russia! It worked!!!

  • @ismailbakhach8990
    @ismailbakhach8990 11 месяцев назад +4

    when i publish mine i got white screen with no error in cmd or console so what the problem ?

    • @ek-developer
      @ek-developer  11 месяцев назад +1

      Try to fork my repo and compare it with your project.

    • @messiisthebest
      @messiisthebest 10 месяцев назад

      same issue

    • @aslanlm
      @aslanlm 8 месяцев назад +1

      sometimes you must change the paths of your script and css in your html in the dist folder, just change /assets for assets

    • @rahulsyt_
      @rahulsyt_ 7 месяцев назад

      Same happening with me

    • @thetalkingkeys6731
      @thetalkingkeys6731 4 месяца назад

      have u solved this error ??

  • @user-ms2bx3xm4e
    @user-ms2bx3xm4e 7 месяцев назад +2

    bro i am using appwrite for backend and i have used client routes of react dom and i have deployed my project using vercel now when i am reloading its going on 404 page of vercel its not reloading my route and i have used your method of changing the html file but its not working . when i realoding using your method its reloading by ~and ~ and keep going . help me through

    • @DungNguyenTien-ww5xc
      @DungNguyenTien-ww5xc 6 месяцев назад

      I also have this problem

    • @AidanDavid-pl6hf
      @AidanDavid-pl6hf 4 месяца назад

      I might be too late but try setting the pathSegmentsToKeep variable in the 404.html file to 0 instead of 1.

  • @MikiyasGirma-y9d
    @MikiyasGirma-y9d 2 месяца назад

    Man you are live saver huge thanks 🥰🥰🥰

  • @mfaeezshabbir
    @mfaeezshabbir Год назад +1

    I was facing same issue on netlify as well as on vercel, will this work for them too or not?

  • @AidanDavid-pl6hf
    @AidanDavid-pl6hf 4 месяца назад

    If you run into the issue where when reloading the page infinitely tries to reload and the URL keeps adding the text ~and~, try setting the pathSegmentsToKeep variable in the 404.html file to 0.

  • @_acky
    @_acky 10 месяцев назад

    hello, I try this on my project but still throws an error "Failed to load resource: the server responded with a status of 404 ".

  • @Noin0y
    @Noin0y 7 месяцев назад

    Amazing! Thank you. 🔥🔥🔥

  • @user-vc1hx3ce2g
    @user-vc1hx3ce2g 8 месяцев назад

    You are my guardian angel 😇😅

  • @kumart2025
    @kumart2025 4 месяца назад

    my case I'm getting this error: App.tsx:1 Uncaught Error: @vitejs/plugin-react can't detect preamble. Something is wrong

  • @joshmejia5513
    @joshmejia5513 Месяц назад

    What is the app you are using to save the code snippets?

  • @arg0x-
    @arg0x- 6 месяцев назад

    Workflow permissions read and write is disabled... I can't seem to enable it

  • @QuangNguyen-yi1ro
    @QuangNguyen-yi1ro 3 месяца назад

    thank u so much!!! I had been struggling with routing for deploying on Github pages for 2 days.

  • @damianr4680
    @damianr4680 3 месяца назад

    To me, the build calls the scripts "src="/assets", so it doesn't work. "src=./..." should do it, but I have to do it manually,
    And still,l when I do that, all I have is an empty ""
    this is driving me insane

  • @kishan.0296
    @kishan.0296 11 месяцев назад +2

    Can anyone help I am getting "unexpected application error 404 not found" when I open my github page after deployment?

    • @ek-developer
      @ek-developer  11 месяцев назад +1

      Did you correctly copy the content from the .yml file and configure the actions?

  • @DungNguyenTien-ww5xc
    @DungNguyenTien-ww5xc 6 месяцев назад

    Can you guide me to change the domain name? I'm changing the domain name but it's getting an error when reloading the page

  • @namitadas5194
    @namitadas5194 Год назад +1

    I have an ecommerce app only frontend with router and also react router 6.4. I am trying to publish my page to github. I m getting 404 application error. Should i follow this steps?

  • @KolyaKovt
    @KolyaKovt 7 месяцев назад

    Thank you very much!

  • @akshanshkaushal9422
    @akshanshkaushal9422 Год назад

    Error: Action failed with "The process '/usr/bin/git' failed with exit code 128"

  • @debs8263
    @debs8263 11 месяцев назад +1

    nah error in deployment phase

  • @richardson6501
    @richardson6501 Год назад +1

    Hero!

  • @garvitbansal9353
    @garvitbansal9353 5 месяцев назад

    Bro i am trying this but after i push it and when i go to the github and change the workflow setting and after that what i see that my deployment is failed (means i see a red cross) please help me sir please because their no more videos about this error

    • @garvitbansal9353
      @garvitbansal9353 5 месяцев назад

      I got this error message "Deploy
      Action failed with "The process '/usr/bin/git' failed with exit code 128""

  • @dpcandra
    @dpcandra 6 месяцев назад

    thank you so much

  • @leonardosarquiz5943
    @leonardosarquiz5943 Год назад +1

    thanks man

  • @Marshi1
    @Marshi1 3 месяца назад

    Ur a god bro

  • @AmaanBilwar
    @AmaanBilwar 2 месяца назад

    nah youre the goat

  • @akshanshkaushal9422
    @akshanshkaushal9422 11 месяцев назад

    no events triggeres defined in "on" in deploy.yml

  • @ilpellegrinostefano.7216
    @ilpellegrinostefano.7216 6 месяцев назад

    thx you bro. !

  • @rakesh_vlogs
    @rakesh_vlogs 9 месяцев назад

    thanks a lot

  • @cb9066
    @cb9066 5 месяцев назад

    thnx bro

  • @d4snky885
    @d4snky885 5 месяцев назад

    not working

  • @simo6lues
    @simo6lues 10 месяцев назад

    Bro my pages are upto 6 and I have backend

  • @priyasashi3523
    @priyasashi3523 11 месяцев назад +1

    Please show how to deploy using windows too.

  • @k.lakshmanakumar9562
    @k.lakshmanakumar9562 6 месяцев назад

    thx buddy

  • @omnimathic
    @omnimathic Год назад

    I forgot to add homepage directory in package json , it is working fine, should I add it?

    • @danishsk6805
      @danishsk6805 Год назад

      If everything is fine don't touch it😂😂😂😂

    • @omnimathic
      @omnimathic Год назад

      😂😂@@danishsk6805

    • @saarza9991
      @saarza9991 9 месяцев назад

      ​@@danishsk6805legendary quote 😂

  • @najmantube
    @najmantube Год назад

    Hi - do you have to use typescript for this to work?

    • @najmantube
      @najmantube Год назад +1

      I'll answer my own question: No, you don't have to use typescript. I changed the file endings (and references to those files) from .tsx to .jsx and all worked. Note: on main.jsx I removed 'as HTMLElement' -- vscode was marking this as typescript only. There is one 'gotcha' in the README, 04. Configuring the routing on App.tsx: The import statement doesn't include 'Link', i.e. import { Outlet } from "react-router-dom"; should be import { Outlet, Link } from "react-router-dom";. I'm not criticising, though. I was tearing my hair out trying to get the routing to work until I came across this EXCELLENT video. Thank you!

    • @ek-developer
      @ek-developer  Год назад

      @@najmantube True, I didn't notice that the Link import was missing, I'll fix it! But I'm glad the video helped you.

    • @najmantube
      @najmantube Год назад +1

      @@ek-developer Extremely helpful! (I've given the repo a star)

  • @akshanshkaushal9422
    @akshanshkaushal9422 Год назад +1

    Kindly reply me

    • @ek-developer
      @ek-developer  Год назад

      First try to fork my repository and compare it with your project, especially the .yml file. Right after that, check the workflow permissions are selected correctly to be able to activate the gh-pages branch

    • @akshanshkaushal9422
      @akshanshkaushal9422 Год назад +1

      @@ek-developer it's done.. I simply did it again and it worked

    • @ek-developer
      @ek-developer  Год назад +1

      @@akshanshkaushal9422 Great!

    • @akshanshkaushal9422
      @akshanshkaushal9422 Год назад +1

      @@ek-developer Thanks for replying!

  • @akshanshkaushal9422
    @akshanshkaushal9422 Год назад

    Permission to Akshanshkaushal/3D_PORTFOLIO.git denied to github-actions[bot].