ts(2304) cannot find name 'window'. What's wrong with my tsconfig.json?
Unanswered
Derock posted this in #help-forum
DerockOP
##
##
src/lib/api.tsimport { edenTreaty } from "@elysiajs/eden";
import { type ElysiaAPI } from "../server/api";
import { env } from "../server/env";
export const app = edenTreaty<ElysiaAPI>(
typeof window === "undefined"
? `http://${env.host}:${env.port}`
: "http://localhost:3000"
);##
tsconfig.json{
"compilerOptions": {
"target": "ESNext",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./src/*"]
},
"types": ["bun-types"]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}