Invalid env variables Nextjs
Hi guys !
It's certainly very dumb but I don't figure it out.
I have set everything correctly from what I've seen in the docs but when I run one of my scripts where I invoke these variables, I have this:
Here is my env.mjs:
Solution:Jump to solution
If you’re running a script outside of nextjs you’ll have to handle reading env from the .env file using library like dotenv when running that script.
4 Replies
whatever process is invoking this file is not loading your .env file correctly
Do I have to add something here :
tsx scripts/embed.ts
?Solution
If you’re running a script outside of nextjs you’ll have to handle reading env from the .env file using library like dotenv when running that script.
ok thank you very much