Hello Josh, I think that a lot of juniors make time to understand that sensitive informations are a very serious subject. Thanks for this efficient tutorial - please continue videos !
@joshtriedcoding2 жыл бұрын
Cheers, they really are one of the most important beginner-concepts
@snivels Жыл бұрын
If you want a goldmine of a video to make, it'll be how to get runtime environment variables working (not build time) with next js and docker without them ending up inside the docker image. It seems like this is a huge issue, and has been for a while with no clear solution. Love your videos!
@skyhappy Жыл бұрын
What variables would only be passed in at runtime?
@snivels Жыл бұрын
@@skyhappy think environment urls or environment secrets to be used in api routes, you'd want them at runtime when you spin up the container so that you don't have to rebuild the image for every environment, you can just promote the same image through environments. That and you don't want secrets being written into the image, like they would be at build time.
@skyhappy Жыл бұрын
@@snivels do you know the solution to this
@simonedwards7101 Жыл бұрын
Thanks for the video Josh. Being new to all this I ended up using env-cmd in the scripts of package.json to load the differences between my home office and town office. Now I just "npm run dev-ho" or "npm run dev-to". I could have just used localhost for both client and server but wanted to do something fancy and use ip addresses based on the specific locations of the offices. All a good learning exercise either way 🙂
@srinivasjoshi46932 жыл бұрын
Your Channel will blow up soon. Thank you for amazing content 🔥
@ThomasAlbuquerque Жыл бұрын
I didn't know about NEXT_PUBLIC prefix in environment variables, thank you so much
@peter0422 жыл бұрын
These are high quality videos, keep pushing bro, and you'll get the rewards
@clickbaitpolice9792 Жыл бұрын
Josh please reply. I want to use Firebase. I’ve set up my variables but I can’t get my config file to read them. It’s all undefined. I’ve tried putting “use server” on the top of the JS file and still nothing works
@techwizard961 Жыл бұрын
Same here. Have you found any solutions??
@skyhappy Жыл бұрын
You should use supabase, it is a better version of firebase as it uses SQL to model your schema which makes life easier. Also the API is way better made as it's essentially a query builder which means it's similar to SQL.
@davidlintin9 ай бұрын
Make sure your .env file is at the root of your project 👍🏻
@bsimpson88811 ай бұрын
Hello Josh, I discovered that with the introduction of the app directory (next 13 i think ) , they changed the behavior of NEXT_PUBLIC environment variables. However it seems that only the variables specified during "build" time are available but not those specified during "runtiime" (e.g. set as env for a docker image ). It would be nice if someone ( preferably you ) could explain how to pass such "deployment" specific variables to the client side, when using next 13 or 14.
@dmytro.nazaruk5 ай бұрын
Hey! What’s the name of extension that shows the weight of bundles next to import command? 3:03
@karthikkhoday55552 ай бұрын
I think it's called import cost
@kanodekoubillybrown3025 Жыл бұрын
My env variables are not available in production , why ?
@JoonatanKarhu Жыл бұрын
Hi, I'm following your tutorial and my .env.local variable won't show in console.log(process.env.variableName); I'm looking for the log value by running in vs code command line: node fileName.js I get undefined as a value Please help, I have been stuck with this for a long time.
@arizona2233 Жыл бұрын
adding NEXT_PUBLIC in front of the variable in .env is needed to console.log
@skyhappy Жыл бұрын
@@arizona2233isn't it also because he has to run it off the build generated by next build, as in the building phase the variables are inserted?