bug: problem with edge runtime and dotenv
swarajbachu opened this issue · comments
Provide environment information
MacOS
Describe the bug
I get problems with edge runtime while using dot env (with env command) problemsLink to reproduction
https://github.com/t3-oss/create-t3-turbo
To reproduce
it is happening on client components, but not on server side componentsserver-side
Additional information
No response
Where are you importing dotenv?
in nextjs
"with-env": "dotenv -e ../../.env --",
"dev": "with-env next dev",
I am using dotenv cli
it is part of dev dependecies
Using it to run a script shouldnt include it in any bundle so i highly doubt this is the cause...
Judging by the trace im guessing you import something in packages/sdb/src/index.ts
?
that's your issue, you're importing dotenv.
This code is not part of the template so please don't put the template as the reproduction repo.
I am importing "import "dotenv/config";
you can't do that in edge runtime and certainly not the browser. you should be good jsut removing that line.