Camuise
Explore posts from serversCDCloudflare Developers
•Created by Camuise on 2/24/2025 in #general-help
Adding multiple addresses at once
For email routing, is there a way to add multiple custom addresses and destination addresses at once? I have a good bunch of addresses I have to set up and it’s quite tedious to go through each of them manually one at a time, setting each one up.
1 replies
TTCTheo's Typesafe Cult
•Created by Camuise on 2/6/2025 in #questions
Unable to have a environment variable only on client?
I'm configuring the
However, this causes an runtime error:
How do I fix this?
better-auth
library for my app and it requires the BETTER_AUTH_URL
environment variable on the client side, therefore I prefixed it as NEXT_PUBLIC_BETTER_AUTH_URL
.
import { createEnv } from "@t3-oss/env-nextjs";
import { z } from "zod";
export const env = createEnv({
/**
* Specify your server-side environment variables schema here. This way you can ensure the app
* isn't built with invalid env vars.
*/
server: {
DATABASE_URL: z.string().url(),
NODE_ENV: z
.enum(["development", "test", "production"])
.default("development"),
BETTER_AUTH_SECRET: z.string(),
DISCORD_CLIENT_ID: z.string(),
DISCORD_CLIENT_SECRET: z.string(),
},
/**
* Specify your client-side environment variables schema here. This way you can ensure the app
* isn't built with invalid env vars. To expose them to the client, prefix them with
* `NEXT_PUBLIC_`.
*/
client: {
NEXT_PUBLIC_BETTER_AUTH_URL: z.string().url(),
},
// ...
});
import { createEnv } from "@t3-oss/env-nextjs";
import { z } from "zod";
export const env = createEnv({
/**
* Specify your server-side environment variables schema here. This way you can ensure the app
* isn't built with invalid env vars.
*/
server: {
DATABASE_URL: z.string().url(),
NODE_ENV: z
.enum(["development", "test", "production"])
.default("development"),
BETTER_AUTH_SECRET: z.string(),
DISCORD_CLIENT_ID: z.string(),
DISCORD_CLIENT_SECRET: z.string(),
},
/**
* Specify your client-side environment variables schema here. This way you can ensure the app
* isn't built with invalid env vars. To expose them to the client, prefix them with
* `NEXT_PUBLIC_`.
*/
client: {
NEXT_PUBLIC_BETTER_AUTH_URL: z.string().url(),
},
// ...
});
Runtime Error
Error: Invalid environment variables
------------------------------------
[project]/node_modules/@t3-oss/env-core/dist/index.js [app-client] (ecmascript)/createEnv/onValidationError<@http://localhost:3000/_next/static/chunks/node_modules_39350d._.js:14996:15
createEnv@http://localhost:3000/_next/static/chunks/node_modules_39350d._.js:15002:16
createEnv@http://localhost:3000/_next/static/chunks/node_modules_39350d._.js:15051:188
[project]/src/env.js [app-client] (ecmascript)@http://localhost:3000/_next/static/chunks/src_ae768f._.js:16:191
instantiateModule/<@http://localhost:3000/_next/static/chunks/_d95469._.js:693:27
runModuleExecutionHooks@http://localhost:3000/_next/static/chunks/_d95469._.js:738:22
instantiateModule@http://localhost:3000/_next/static/chunks/_d95469._.js:691:32
getOrInstantiateModuleFromParent@http://localhost:3000/_next/static/chunks/_d95469._.js:624:12
esmImport@http://localhost:3000/_next/static/chunks/_d95469._.js:142:52
[project]/src/lib/auth-client.ts [app-client] (ecmascript)@http://localhost:3000/_next/static/chunks/src_ae768f._.js:71:137
instantiateModule/<@http://localhost:3000/_next/static/chunks/_d95469._.js:693:27
runModuleExecutionHooks@http://localhost:3000/_next/static/chunks/_d95469._.js:738:22
instantiateModule@http://localhost:3000/_next/static/chunks/_d95469._.js:691:32
getOrInstantiateModuleFromParent@http://localhost:3000/_next/static/chunks/_d95469._.js:624:12
esmImport@http://localhost:3000/_next/static/chunks/_d95469._.js:142:52
[project]/src/app/auth/[auth]/auth-view.tsx [app-client] (ecmascript)@http://localhost:3000/_next/static/chunks/src_ae768f._.js:419:155
instantiateModule/<@http://localhost:3000/_next/static/chunks/_d95469._.js:693:27
runModuleExecutionHooks@http://localhost:3000/_next/static/chunks/_d95469._.js:738:22
instantiateModule@http://localhost:3000/_next/static/chunks/_d95469._.js:691:32
getOrInstantiateModuleFromParent@http://localhost:3000/_next/static/chunks/_d95469._.js:624:12
commonJsRequire@http://localhost:3000/_next/static/chunks/_d95469._.js:157:52
requireModule@http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_107ce8._.js:2676:50
initializeModuleChunk@http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_107ce8._.js:3218:38
resolveModuleChunk@http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_107ce8._.js:3187:43
[project]/node_modules/next/dist/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js [app-client] (ecmascript)/resolveModule/<@http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_107ce8._.js:3527:24
Runtime Error
Error: Invalid environment variables
------------------------------------
[project]/node_modules/@t3-oss/env-core/dist/index.js [app-client] (ecmascript)/createEnv/onValidationError<@http://localhost:3000/_next/static/chunks/node_modules_39350d._.js:14996:15
createEnv@http://localhost:3000/_next/static/chunks/node_modules_39350d._.js:15002:16
createEnv@http://localhost:3000/_next/static/chunks/node_modules_39350d._.js:15051:188
[project]/src/env.js [app-client] (ecmascript)@http://localhost:3000/_next/static/chunks/src_ae768f._.js:16:191
instantiateModule/<@http://localhost:3000/_next/static/chunks/_d95469._.js:693:27
runModuleExecutionHooks@http://localhost:3000/_next/static/chunks/_d95469._.js:738:22
instantiateModule@http://localhost:3000/_next/static/chunks/_d95469._.js:691:32
getOrInstantiateModuleFromParent@http://localhost:3000/_next/static/chunks/_d95469._.js:624:12
esmImport@http://localhost:3000/_next/static/chunks/_d95469._.js:142:52
[project]/src/lib/auth-client.ts [app-client] (ecmascript)@http://localhost:3000/_next/static/chunks/src_ae768f._.js:71:137
instantiateModule/<@http://localhost:3000/_next/static/chunks/_d95469._.js:693:27
runModuleExecutionHooks@http://localhost:3000/_next/static/chunks/_d95469._.js:738:22
instantiateModule@http://localhost:3000/_next/static/chunks/_d95469._.js:691:32
getOrInstantiateModuleFromParent@http://localhost:3000/_next/static/chunks/_d95469._.js:624:12
esmImport@http://localhost:3000/_next/static/chunks/_d95469._.js:142:52
[project]/src/app/auth/[auth]/auth-view.tsx [app-client] (ecmascript)@http://localhost:3000/_next/static/chunks/src_ae768f._.js:419:155
instantiateModule/<@http://localhost:3000/_next/static/chunks/_d95469._.js:693:27
runModuleExecutionHooks@http://localhost:3000/_next/static/chunks/_d95469._.js:738:22
instantiateModule@http://localhost:3000/_next/static/chunks/_d95469._.js:691:32
getOrInstantiateModuleFromParent@http://localhost:3000/_next/static/chunks/_d95469._.js:624:12
commonJsRequire@http://localhost:3000/_next/static/chunks/_d95469._.js:157:52
requireModule@http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_107ce8._.js:2676:50
initializeModuleChunk@http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_107ce8._.js:3218:38
resolveModuleChunk@http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_107ce8._.js:3187:43
[project]/node_modules/next/dist/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js [app-client] (ecmascript)/resolveModule/<@http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_107ce8._.js:3527:24
12 replies