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

Environment Variable Clarification #170

Closed
flawsom opened this issue Mar 22, 2024 · 15 comments
Closed

Environment Variable Clarification #170

flawsom opened this issue Mar 22, 2024 · 15 comments
Labels
documentation Improvements or additions to documentation env Environment variables/configurations good first issue Good for newcomers

Comments

@flawsom
Copy link

flawsom commented Mar 22, 2024

why is still running on preview mode with skeletons, what am i doing wrong ? ( i followed it exactly as u instructed in the env's and without "" for the links )

Screenshot (25)

@canal8064
Copy link

canal8064 commented Mar 22, 2024

For deployments make sure you are adding the environment variables from .env.example correctly. Keep in mind the proxy provided has rate limiting;

image

@flawsom
Copy link
Author

flawsom commented Mar 23, 2024

Am I doing anything wrong here @trying559 @akionii

Screenshot_2024-03-23-22-25-25-52_40deb401b9ffe8e1df2f1cc5ba480b12

@user70853572305239875909542835673652937
Copy link
Collaborator

Hey! Checked out the screenshot, and your setup looks all good to me. Spotted 'miruro2' in the URL, and when I looked up miruro2.vercel.app, I found a live app – could be yours, right?

If you're running into trouble getting things to work, take a look at the project's readme. You'll find a Vercel Deploy button there. Make sure to enter your env variables exactly as they're shown in your .env.example.
. Stick to that, and you should see your app up and running in no time. 👐

And hey, just to make things a tad easier, here's the deploy button again for quick access:

Deploy with Vercel

If you need any more help, just give a shout. 👋

@flawsom
Copy link
Author

flawsom commented Mar 23, 2024

Even after adding it exactly as it was guided in the .env.example

Am still facing the similar issue at https://miruro3.vercel.app/
@akionii @trying559

Can u deploy a new demo and send me a SS of how u did it ( idk why it isn't working )

Screenshot_2024-03-24-00-06-05-99_40deb401b9ffe8e1df2f1cc5ba480b12

@user70853572305239875909542835673652937
Copy link
Collaborator

Hey again!

Remember, no need for ("") quotes on Vercel deployment. You got this!

Also, just a heads-up, I'll be putting together a simple video guide on deploying with Miruro to make things even easier for you.

If you need any more help, just give me a shout. Cheers!

@flawsom
Copy link
Author

flawsom commented Mar 23, 2024

I will be eagerly waiting for the video guide

Can't seem to resolve this part with or without ""

@user70853572305239875909542835673652937 user70853572305239875909542835673652937 changed the title A little bit of guidance for the starters of this project Vercel Deployment Issue: Environment Variable Clarification Required Mar 23, 2024
@flawsom
Copy link
Author

flawsom commented Mar 24, 2024

am still facing the issue here is it something with indian ip's?? @akionii @trying559

miruro3.mp4

@canal8064
Copy link

I think this might be due to the fact that the VITE_PROXY_URL which is https://corsproxy.io is blocked in your country. Try with another Corsproxy provider and let us know.

@flawsom
Copy link
Author

flawsom commented Mar 29, 2024

@trying559 @akionii still the same issue,
Would there be any issues if i comment the corsproxy part out, is it switchable..?

@techroy23
Copy link
Contributor

Hi @akionii I'm also getting the same error message. I want to have everything locally hosted on my own computer. I made changes to the .env file but got the same error. I tried hosting my own corsproxy but got the same error.

VITE_IS_LOCAL=true
VITE_LOCAL_IP=192.168.200.200
VITE_BACKEND_URL=http://localhost:3000
VITE_SKIP_TIMES=http://api.aniskip.com
VITE_PROXY_URL=https://corsproxy.io
PORT=60000

Please see all screenshot below
image
image

@MaviMods
Copy link

Hi @akionii I'm also getting the same error message. I want to have everything locally hosted on my own computer. I made changes to the .env file but got the same error. I tried hosting my own corsproxy but got the same error.

VITE_IS_LOCAL=true
VITE_LOCAL_IP=192.168.200.200
VITE_BACKEND_URL=http://localhost:3000
VITE_SKIP_TIMES=http://api.aniskip.com
VITE_PROXY_URL=https://corsproxy.io
PORT=60000

Please see all screenshot below image image

Hy bro thats proxy error you made consumet api not corsproxy!!

@user70853572305239875909542835673652937
Copy link
Collaborator

Hey everyone! 👋

Let's tackle a few things to smooth out our deployment and local development workflows. There's quite a bit to cover, so I'll dive straight in:

@flawsom, regarding the CORS proxy issue: if you're unable to find a service that works in your region, reach out to me directly. I can guide you on how to adjust the code to operate without the CORS proxy. Just a heads-up, this might result in a slower initial response time due to the lack of caching that corsproxy.io provides. If that's a trade-off you're willing to consider, I'm here to help.

@techroy23, thanks to @MaviMods for spotting the typo. It should be corsproxy.io, not consumet. However, the real culprit here is the missing trailing slashes for VITE_BACKEND_URL and VITE_SKIP_TIMES. They should both end with a "/", like this:

VITE_BACKEND_URL="http://localhost:3000/"
VITE_SKIP_TIMES="http://api.aniskip.com/"

Why the fuss over the trailing slash? Well, some servers interpret the paths differently if there's no trailing slash. It can lead to incorrect request handling or routing on the server-side, which in turn, causes 404 errors.

For everyone, I'm rolling out an update with a nifty little function, ensureUrlEndsWithSlash, which will append a slash to your URLs if they're missing one. This will help prevent routing issues and ensure our requests hit the right endpoints.

Here's a sneak peek at the function:

// Ensures that all URLs end with a slash for consistency
function ensureUrlEndsWithSlash(url) {
  return url.endsWith('/') ? url : `${url}/`;
}

In the next commit, this function will be integrated, so you'll have one less thing to worry about.

Lastly, the latest .env.example looks like this:

VITE_BACKEND_URL="https://public-miruro-consumet-api.vercel.app/"
VITE_SKIP_TIMES="https://api.aniskip.com/"
VITE_PROXY_URL="https://corsproxy.io"
PORT=5173

Please note that VITE_IS_LOCAL and VITE_LOCAL_IP have been deprecated. Our app now auto-detects the local IP in production when you run bun start.

Remember, for any further clarification or assistance, I'm just a message away. Keep up the great work. And, as always, a huge shoutout to @MaviMods for the assist. 👍

Cheers,
@akionii

@techroy23
Copy link
Contributor

@akionii can you also guide me what to adjust so i can run this without corsproxy?

@user70853572305239875909542835673652937
Copy link
Collaborator

Sure! I'll drop a guide in our Discord channel as soon as I can on how to get everything up and running without the need for a CORS Proxy. Keep an eye out! 👀

@user70853572305239875909542835673652937 user70853572305239875909542835673652937 changed the title Vercel Deployment Issue: Environment Variable Clarification Required Environment Variable Clarification Apr 1, 2024
@user70853572305239875909542835673652937 user70853572305239875909542835673652937 added documentation Improvements or additions to documentation env Environment variables/configurations labels Apr 1, 2024
@techroy23
Copy link
Contributor

@akionii i think we can tag this one as resolve for now. I tested the current build without corsproxy and it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation env Environment variables/configurations good first issue Good for newcomers
Projects
No open projects
Status: Done
Development

No branches or pull requests

5 participants