T3 Env Not Showing Type Errors

Hello, I have the following env.mjs file but there is no type error be shown in my IDE even though UPSTASH_API_KEY is not defined in the runtimeEnv. Any idea why this is?
// ./src/env.mjs
import { createEnv } from "@t3-oss/env-nextjs";
import { z } from "zod";

export const env = createEnv({
server: {
UPSTASH_API_KEY: z.string(),
},
client: {},
runtimeEnv: {},
});
// ./src/env.mjs
import { createEnv } from "@t3-oss/env-nextjs";
import { z } from "zod";

export const env = createEnv({
server: {
UPSTASH_API_KEY: z.string(),
},
client: {},
runtimeEnv: {},
});
2 Replies
Sybatron
Sybatron2y ago
did you import env in your config files of the chosen framework?
Liam
LiamOP2y ago
Yup
import "./src/env.mjs";

/** @type {import('next').NextConfig} */
const nextConfig = {};

module.exports = nextConfig;
import "./src/env.mjs";

/** @type {import('next').NextConfig} */
const nextConfig = {};

module.exports = nextConfig;
Want results from more Discord servers?
Add your server