NextAuth Warn on when after npm run dev
Unanswered
Artois Hound posted this in #help-forum
Artois HoundOP
I get this message when I run npm run dev, I have not noticed any actual issues, I am just curious why it gets logged in the console.
6 Replies
@Artois Hound I get this message when I run npm run dev, I have not noticed any actual issues, I am just curious why it gets logged in the console.
Environment variable NEXTAUTH_URL missing. Please set it in your .env file. – https://next-auth.js.org/warnings#nextauth_url
set the env variable
@joulev > Environment variable NEXTAUTH_URL missing. Please set it in your .env file. – <https://next-auth.js.org/warnings#nextauth_url>
Artois HoundOP
What is the URL used for in there? the authentication seems to work fine without it
@Artois Hound What is the URL used for in there? the authentication seems to work fine without it
[it is used internally in many places](https://github.com/search?q=repo%3Anextauthjs%2Fnext-auth+NEXTAUTH_URL+path%3A%2F%5Epackages%5C%2Fnext-auth%5C%2F%2F&type=code), the fact that it works fine without it probably means you are very lucky
i don't know more than that to answer you in details though; either way it's good practice to add the env var even when it works fine without it
@joulev [it is used internally in many places](<https://github.com/search?q=repo%3Anextauthjs%2Fnext-auth+NEXTAUTH_URL+path%3A%2F%5Epackages%5C%2Fnext-auth%5C%2F%2F&type=code>), the fact that it works fine without it probably means you are very lucky
Artois HoundOP
I already did, I was just curious thx for the link here.