Index.html not rendering assets (password protected website, Vercel)
Unanswered
eL posted this in #help-forum
eLOP
Hey people! I have a question -- πββοΈ I hope I can ask this here.
I made a website, html, css, and a bit of js, using VScode and Git. I push it to Github, and then it's deployed using Vercel.
The website is password protected, using Vercel's environment variables I designed the landing page (index) with some assets (background.jpg, styles.css, and a font.woff2), and this is where you type the password to enter.
When I access the website on someone's phone, the landing page just looks like a raw html page. no assets rendering. After I type the password, and enter, and then go back to the landing page, it will render correctly.
My theory: before typing the password, the browser has no access to these assets, but once logged in, the assets will be cached, so it will work.
Can someone confirm me this? And how to fix it, I want these assets available "publicly" so that the browser can render them without password entered. Thx!!
I made a website, html, css, and a bit of js, using VScode and Git. I push it to Github, and then it's deployed using Vercel.
The website is password protected, using Vercel's environment variables I designed the landing page (index) with some assets (background.jpg, styles.css, and a font.woff2), and this is where you type the password to enter.
When I access the website on someone's phone, the landing page just looks like a raw html page. no assets rendering. After I type the password, and enter, and then go back to the landing page, it will render correctly.
My theory: before typing the password, the browser has no access to these assets, but once logged in, the assets will be cached, so it will work.
Can someone confirm me this? And how to fix it, I want these assets available "publicly" so that the browser can render them without password entered. Thx!!
.root/
βββ assets/
β βββ background.jpg
β βββ banner.jpg
β βββ picuture.jpg
βββ fonts/
β βββ font.woff
β βββ font.woff2
βββ js/
β βββ script.js
βββ index.html
βββ page1.html
βββ page2.html
βββ page3.html
βββ styles.css
βββ index.css
βββ middlesware.js
βββ vercel.json3 Replies
Fire ant
nextjs?
@Fire ant nextjs?
eLOP
Yes, I'm using middleware.js. I suspect that it is there. Btw, I'm not a dev and just learning everything as I build. So any inputs are welcome!
I also lack the words to search Google effectively