Deploy Vite React App to GitHub Pages (2024)

Поделиться
HTML-код
  • Опубликовано: 26 апр 2024
  • Looking to deploy your Vite React app to GitHub Pages? This video provides a clear, step-by-step guide to get you started! Learn how to configure your project, set up a GitHub workflow, Vite config, and leverage GitHub Pages for deployment. Whether you're a seasoned React developer or just getting started with Vite, this tutorial will equip you to showcase your app to the world! ✨
    #vitejs #react #react #github #deploy
    Blog post: www.vddeveloper.online/blog/v...

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

  • @VladyslavDihtiarenko
    @VladyslavDihtiarenko  19 дней назад

    If you use React Router in your project, you're probably facing an issue with empty pages (blank screen with no errors in the console) or 404 not found errors for your assets. Check out this video, I've covered those issues there: ruclips.net/video/uStf2HMXcAs/видео.html

  • @alimanghat9114
    @alimanghat9114 8 дней назад +1

    I have never once commented on a youtube video but this video just saved me big time. I spent hours trying to figure it out but luckily finally came across this video. Thank you very much!

    • @VladyslavDihtiarenko
      @VladyslavDihtiarenko  4 дня назад

      Appreciate it!

    • @zainmashhood7943
      @zainmashhood7943 4 дня назад

      @@VladyslavDihtiarenko The process '/opt/hostedtoolcache/node/16.20.2/x64/bin/npm' failed with exit code 1 please help me with this error

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

    You saved me! Thank you so much!

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

    thanks buddy works like a charm appricated

  • @user-oz5mx1sd4u
    @user-oz5mx1sd4u Месяц назад +1

    Thank you! It was vey helpful!

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

      Appreciate it!

    • @zainmashhood7943
      @zainmashhood7943 4 дня назад

      The process '/opt/hostedtoolcache/node/16.20.2/x64/bin/npm' failed with exit code 1 please help me with this error

  • @huzaifaimran9468
    @huzaifaimran9468 10 дней назад

    Lifesaver tutorial for real, Deployed Easily at one go, Underrated Channel! Thank you, you have my like and subscribe!

    • @VladyslavDihtiarenko
      @VladyslavDihtiarenko  10 дней назад +1

      So glad it was helpful! Thanks for subscribing!

    • @zainmashhood7943
      @zainmashhood7943 4 дня назад

      @@VladyslavDihtiarenko The process '/opt/hostedtoolcache/node/16.20.2/x64/bin/npm' failed with exit code 1 please help me with this error

  • @Timepass-xb2yb
    @Timepass-xb2yb 20 дней назад

    Thank you so much
    This was really helpful

    • @VladyslavDihtiarenko
      @VladyslavDihtiarenko  20 дней назад

      Appreciate it!

    • @zainmashhood7943
      @zainmashhood7943 4 дня назад

      @@VladyslavDihtiarenko The process '/opt/hostedtoolcache/node/16.20.2/x64/bin/npm' failed with exit code 1 please help me with this error

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

    Thanks brother. appreciate a lot.

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

    Thank you for this video

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

    Thanks brother very helpful..

  • @prodpreston
    @prodpreston 16 дней назад

    Good looks crodie

  • @potato-ip9tp
    @potato-ip9tp Месяц назад +2

    it's work. thanks!!!!!!!!!!!!!!

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

    дякую!

  • @Tjiaz-
    @Tjiaz- 17 дней назад

    Thank you

  • @otzmediaz4387
    @otzmediaz4387 13 дней назад +1

    usually i don't comment in video but this video help me lot thanks for that 🥰

    • @VladyslavDihtiarenko
      @VladyslavDihtiarenko  13 дней назад

      Thank you a lot! Glad it helped!

    • @zainmashhood7943
      @zainmashhood7943 4 дня назад

      @@VladyslavDihtiarenko The process '/opt/hostedtoolcache/node/16.20.2/x64/bin/npm' failed with exit code 1 please help me with this error

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

    Thank you.

  • @user-dj2iu2zv7r
    @user-dj2iu2zv7r Месяц назад

    thank you sir its works , it was more help full to me☺

    • @VladyslavDihtiarenko
      @VladyslavDihtiarenko  24 дня назад

      Appreciate it a lot!

    • @zainmashhood7943
      @zainmashhood7943 4 дня назад

      @@VladyslavDihtiarenko The process '/opt/hostedtoolcache/node/16.20.2/x64/bin/npm' failed with exit code 1 please help me with this error

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

    Thanks, I successfully deployed my code, but there is a problem with images/icons. Seems like there is some problem with relative paths.

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

      Check out my new view where I showed how to fix this issue: ruclips.net/video/uStf2HMXcAs/видео.html&ab_channel=VladyslavDihtiarenko

  • @kresimircosic3753
    @kresimircosic3753 20 дней назад

    Blank page, console is completely empty.
    When I added the base property with the repo name, the deployment manages to render the Vite icon as the app icon in the tab title, so that works, but it's like the index.html is not served at all

    • @VladyslavDihtiarenko
      @VladyslavDihtiarenko  20 дней назад +1

      Hi, welcome to my channel! I've just released a video showing how to address this issue in Vite React projects. Check it out: ruclips.net/video/uStf2HMXcAs/видео.htmlsi=xShS2ai5-dr4Ujl6

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

    it's work. thanks 🤗👌

  • @user-km8rs4tj5w
    @user-km8rs4tj5w 18 дней назад

    what if we use react-router-dom in the project? it requires more configurations to support react-router on GitHub pages

    • @VladyslavDihtiarenko
      @VladyslavDihtiarenko  18 дней назад

      Check out my new video where I covered issues when we use React Router along with base url in Vite config file: ruclips.net/video/uStf2HMXcAs/видео.html

  • @Kerchiano
    @Kerchiano 24 дня назад

    Здравствуйте! Владислав, а у меня возникают проблемы с отображением картинок которые находятся в папке assets. И в принципе с переходами на другие урл если не добавить роуты. Есть ли возможность как-то это решить?

    • @VladyslavDihtiarenko
      @VladyslavDihtiarenko  24 дня назад

      Приветствую! Похоже, что многие сталкиваются с этой проблемой. И она кроется в base адресе, который мы устанавливаем в vite config.
      В случае с переходом на другие роуты, проблема в React Router (подразумевая, что именно его вы используете), в котором нужно тоже прописывать basename: v5.reactrouter.com/web/api/BrowserRouter/basename-string
      А в случае директории src/assets нужно смотреть отдельные случаи. Если статический импорт через import, то Vite решает проблему автоматически. Но если указываем путь в самом jsx (к примеру, в src атрибуте img тега), то возможно нужно самому к пути прибавлять base url, который доступен через import.meta.env.BASE_URL: vitejs.dev/guide/build.html#public-base-path

  • @zainmashhood7943
    @zainmashhood7943 4 дня назад

    The process '/opt/hostedtoolcache/node/16.20.2/x64/bin/npm' failed with exit code 1 please help me with this error

    • @VladyslavDihtiarenko
      @VladyslavDihtiarenko  2 дня назад

      Honestly, I don't know what it is. I need a bigger picture of your issue. Contact me through social media to show a full error log

  • @netizen_94
    @netizen_94 18 дней назад

    I'm confused, so you push the entire project, or just the content of "dist" folder created by the build process? Answer:

    • @VladyslavDihtiarenko
      @VladyslavDihtiarenko  18 дней назад +1

      You don't need to push the dist folder. Push the entire project. 'Dist' is added to .gitignore automatically by Vite so Git doesn't track this folder (i.e. don't include it in commits history).
      The dist folder (the builded project) is automatically created during the workflow as a build result (that's why we create this file)

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

      @@VladyslavDihtiarenko thanks, why when I use the vite's website workflow it fails, I notice it doesn't create the extra branch

    • @VladyslavDihtiarenko
      @VladyslavDihtiarenko  17 дней назад +1

      @@netizen_94 It didn't create that extra branch for me as well

  • @jjyyyy-zc6cr
    @jjyyyy-zc6cr 4 дня назад

    can you help me sir, i followed but when i go to my website it doesn't show anything and it says error 404 in dev tools

  • @yacinbensidahmed6587
    @yacinbensidahmed6587 Месяц назад +1

    I have a problem with my photos won't show in the page

    • @dheerajsaini1353
      @dheerajsaini1353 29 дней назад +1

      Same issue occurred with my e-commerce project, I had to click on the shop menu button to render the product images.

    • @VladyslavDihtiarenko
      @VladyslavDihtiarenko  24 дня назад +1

      I could help you if you share a link to you repo here or through social media. The issue could be with the baseUrl we set in Vite config, or with React Router if you use it in your project.

    • @dheerajsaini1353
      @dheerajsaini1353 24 дня назад

      Yes that was the problem i fixed it already

  • @kulikitakati549
    @kulikitakati549 21 день назад

    what vscode theme is that?

    • @VladyslavDihtiarenko
      @VladyslavDihtiarenko  21 день назад

      Community Material Theme High Contrast: marketplace.visualstudio.com/items?itemName=Equinusocio.vsc-community-material-theme

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

    how do we deploy the backend?

    • @VladyslavDihtiarenko
      @VladyslavDihtiarenko  22 дня назад

      This video is only about the frontend part. Consider to find another tutorial for backend.

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

    In my sources i only have the options main and none, no gh-pages

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

      Try to switch to Github Actions, and then again back to Deploy from a branch

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

      @@VladyslavDihtiarenko i also get this unusual error 404 (main.jsx resource not found)in my console.Is there a specific way to put my main.jsx file path

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

      Did you set "base" in your vite config according to your repo name? 0:45
      For example, If your repo name is vite-react, set base: "/vite-react/"

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

      I did, but when i deploy it first routes to the not found page

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

      @@Thee_Don96 send me a link to your repo

  • @yaswantkumar9112
    @yaswantkumar9112 Месяц назад +1

    i am gettingn a blank page bro !!

  • @user-vw8rh9rp3k
    @user-vw8rh9rp3k 12 дней назад

    Your tutorial was very bad. Not even a single work has been done. He is not deployed

    • @VladyslavDihtiarenko
      @VladyslavDihtiarenko  12 дней назад

      Welcome to my channel! To improve the tutorial, could you tell me what deployment issues you faced?