Тёмный

Deploy Vite React App to GitHub Pages (2024) 

Vladyslav Dihtiarenko
Подписаться 680
Просмотров 6 тыс.
50% 1

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...

Опубликовано:

 

26 апр 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 77   
@VladyslavDihtiarenko
@VladyslavDihtiarenko 25 дней назад
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: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-uStf2HMXcAs.html
@alimanghat9114
@alimanghat9114 14 дней назад
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 10 дней назад
Appreciate it!
@zainmashhood7943
@zainmashhood7943 9 дней назад
@@VladyslavDihtiarenko The process '/opt/hostedtoolcache/node/16.20.2/x64/bin/npm' failed with exit code 1 please help me with this error
@suryanagcs
@suryanagcs 2 месяца назад
thanks buddy works like a charm appricated
@VladyslavDihtiarenko
@VladyslavDihtiarenko 2 месяца назад
You're welcome!
@zyates
@zyates 22 дня назад
You saved me! Thank you so much!
@VladyslavDihtiarenko
@VladyslavDihtiarenko 22 дня назад
You're welcome!
@user-oz5mx1sd4u
@user-oz5mx1sd4u Месяц назад
Thank you! It was vey helpful!
@VladyslavDihtiarenko
@VladyslavDihtiarenko Месяц назад
Appreciate it!
@zainmashhood7943
@zainmashhood7943 9 дней назад
The process '/opt/hostedtoolcache/node/16.20.2/x64/bin/npm' failed with exit code 1 please help me with this error
@huzaifaimran9468
@huzaifaimran9468 15 дней назад
Lifesaver tutorial for real, Deployed Easily at one go, Underrated Channel! Thank you, you have my like and subscribe!
@VladyslavDihtiarenko
@VladyslavDihtiarenko 15 дней назад
So glad it was helpful! Thanks for subscribing!
@zainmashhood7943
@zainmashhood7943 9 дней назад
@@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 26 дней назад
Thank you so much This was really helpful
@VladyslavDihtiarenko
@VladyslavDihtiarenko 26 дней назад
Appreciate it!
@zainmashhood7943
@zainmashhood7943 9 дней назад
@@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.
@VladyslavDihtiarenko
@VladyslavDihtiarenko Месяц назад
😎
@mohiramansurovna4295
@mohiramansurovna4295 Месяц назад
Thank you for this video
@VladyslavDihtiarenko
@VladyslavDihtiarenko Месяц назад
thanks for watching!
@maryamsaleh5259
@maryamsaleh5259 23 дня назад
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 23 дня назад
Check out my new view where I showed how to fix this issue: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-uStf2HMXcAs.html&ab_channel=VladyslavDihtiarenko
@user-km8rs4tj5w
@user-km8rs4tj5w 24 дня назад
what if we use react-router-dom in the project? it requires more configurations to support react-router on GitHub pages
@VladyslavDihtiarenko
@VladyslavDihtiarenko 24 дня назад
Check out my new video where I covered issues when we use React Router along with base url in Vite config file: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-uStf2HMXcAs.html
@Kerchiano
@Kerchiano 29 дней назад
Здравствуйте! Владислав, а у меня возникают проблемы с отображением картинок которые находятся в папке assets. И в принципе с переходами на другие урл если не добавить роуты. Есть ли возможность как-то это решить?
@VladyslavDihtiarenko
@VladyslavDihtiarenko 29 дней назад
Приветствую! Похоже, что многие сталкиваются с этой проблемой. И она кроется в 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
@kresimircosic3753
@kresimircosic3753 25 дней назад
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 25 дней назад
Hi, welcome to my channel! I've just released a video showing how to address this issue in Vite React projects. Check it out: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-uStf2HMXcAs.htmlsi=xShS2ai5-dr4Ujl6
@potato-ip9tp
@potato-ip9tp 2 месяца назад
it's work. thanks!!!!!!!!!!!!!!
@VladyslavDihtiarenko
@VladyslavDihtiarenko 2 месяца назад
No problem :)
@MonkeyWrenchMechanicManiac
@MonkeyWrenchMechanicManiac Месяц назад
Thanks brother very helpful..
@VladyslavDihtiarenko
@VladyslavDihtiarenko Месяц назад
Appreciate it! 😊
@user-dj2iu2zv7r
@user-dj2iu2zv7r Месяц назад
thank you sir its works , it was more help full to me☺
@VladyslavDihtiarenko
@VladyslavDihtiarenko Месяц назад
Appreciate it a lot!
@zainmashhood7943
@zainmashhood7943 9 дней назад
@@VladyslavDihtiarenko The process '/opt/hostedtoolcache/node/16.20.2/x64/bin/npm' failed with exit code 1 please help me with this error
@Tjiaz-
@Tjiaz- 22 дня назад
Thank you
@VladyslavDihtiarenko
@VladyslavDihtiarenko 22 дня назад
You're welcome
@otzmediaz4387
@otzmediaz4387 18 дней назад
usually i don't comment in video but this video help me lot thanks for that 🥰
@VladyslavDihtiarenko
@VladyslavDihtiarenko 18 дней назад
Thank you a lot! Glad it helped!
@zainmashhood7943
@zainmashhood7943 9 дней назад
@@VladyslavDihtiarenko The process '/opt/hostedtoolcache/node/16.20.2/x64/bin/npm' failed with exit code 1 please help me with this error
@funfstuck
@funfstuck Месяц назад
дякую!
@VladyslavDihtiarenko
@VladyslavDihtiarenko Месяц назад
👌
@farazk9729
@farazk9729 Месяц назад
Thank you.
@VladyslavDihtiarenko
@VladyslavDihtiarenko Месяц назад
👌
@prodpreston
@prodpreston 22 дня назад
Good looks crodie
@zainmashhood7943
@zainmashhood7943 9 дней назад
The process '/opt/hostedtoolcache/node/16.20.2/x64/bin/npm' failed with exit code 1 please help me with this error
@VladyslavDihtiarenko
@VladyslavDihtiarenko 8 дней назад
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
@netbug94
@netbug94 23 дня назад
I'm confused, so you push the entire project, or just the content of "dist" folder created by the build process? Answer:
@VladyslavDihtiarenko
@VladyslavDihtiarenko 23 дня назад
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)
@netbug94
@netbug94 23 дня назад
@@VladyslavDihtiarenko thanks, why when I use the vite's website workflow it fails, I notice it doesn't create the extra branch
@VladyslavDihtiarenko
@VladyslavDihtiarenko 22 дня назад
@@netbug94 It didn't create that extra branch for me as well
@Rootblack04
@Rootblack04 Месяц назад
it's work. thanks 🤗👌
@VladyslavDihtiarenko
@VladyslavDihtiarenko Месяц назад
🫡
@jjyyyy-zc6cr
@jjyyyy-zc6cr 10 дней назад
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
@jjyyyy-zc6cr
@jjyyyy-zc6cr 9 дней назад
ohh i got it, I misspelled my setbase😅 thanks anyway for the tutorial
@VladyslavDihtiarenko
@VladyslavDihtiarenko 8 дней назад
Glad you solved it :)
@The_DollMaster
@The_DollMaster 2 дня назад
Doesn't work :c
@kulikitakati549
@kulikitakati549 26 дней назад
what vscode theme is that?
@VladyslavDihtiarenko
@VladyslavDihtiarenko 26 дней назад
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 28 дней назад
This video is only about the frontend part. Consider to find another tutorial for backend.
@yacinbensidahmed6587
@yacinbensidahmed6587 Месяц назад
I have a problem with my photos won't show in the page
@dheerajsaini1353
@dheerajsaini1353 Месяц назад
Same issue occurred with my e-commerce project, I had to click on the shop menu button to render the product images.
@VladyslavDihtiarenko
@VladyslavDihtiarenko Месяц назад
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 Месяц назад
Yes that was the problem i fixed it already
@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 Месяц назад
i am gettingn a blank page bro !!
@VladyslavDihtiarenko
@VladyslavDihtiarenko Месяц назад
any errors in the console?
@user-vw8rh9rp3k
@user-vw8rh9rp3k 18 дней назад
Your tutorial was very bad. Not even a single work has been done. He is not deployed
@VladyslavDihtiarenko
@VladyslavDihtiarenko 17 дней назад
Welcome to my channel! To improve the tutorial, could you tell me what deployment issues you faced?
Далее
How To Deploy A React App To Github Pages (Simple)
10:00
Next.js 15 Ruins Caching Even More
13:56
Просмотров 35 тыс.
Fetching Data Doesn't Get Better Than This
6:58
Просмотров 86 тыс.
My Favourite React Chart Library
7:55
Просмотров 21 тыс.
How to Deploy Your Vite App to Github Pages
3:53
Просмотров 62 тыс.
Deploy Your React App on GitHub Pages in 5 Minutes!
6:39