t3-oss / create-t3-turbo

Clean and simple starter repo using the T3 Stack along with Expo React Native

Home Page:https://turbo.t3.gg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug: problem with edge runtime and dotenv

swarajbachu opened this issue · comments

Provide environment information

MacOS

Describe the bug

Screenshot 2024-02-26 at 12 43 59 PM I get problems with edge runtime while using dot env (with env command) problems

Link 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.