plain text environment variables are not available under env

when I set encrypted secrets, they're shown in env.SOME_SECRET , for example. if I set a plain text variable in the CF dashboard, env.SOME_PLAIN_TEXT is NOT available what gives?
8 Replies
Walshy
Walshy•2w ago
are you using nuxt?
dev
dev•2w ago
remix so I had to put all my plain text variables in my toml file (which then creates another set of issues https://github.com/cloudflare/workers-sdk/issues/6931) but really I'd like to manage everything from the dashboard. I don't see the point of having to manage things from two places
Walshy
Walshy•2w ago
Ah yeah if you use wrangler.toml that becomes your source of truth You can not use it and fully use dash though if you wanted
dev
dev•2w ago
are you saying that if I remove my wrangler toml file, it should work? but that also makes no sense because secrets were working just fine. onyl plain text variables were not being passed to my page context
Walshy
Walshy•2w ago
Yes And secrets are special since they don't have content stored anyway, they cannot be put in a wrangler.toml and are a set-once thing. They do indeed work in dash or elsewhere
dev
dev•2w ago
and if I wanna use plain text variables locally I just put them in .dev.vars as well? (assuming I remove my toml file) also, if I remove my toml file I won't be able to do this:
[[d1_databases]]
binding = "DB"
database_name = "XXXXX-db-local"
database_id = "123"

[[env.preview.d1_databases]]
binding = "DB"
database_name = "XXXXX-db-preview"
database_id = "XXXXXX"

[[env.production.d1_databases]]
binding = "DB"
database_name = "XXXXX-db"
database_id = "XXXXX"
[[d1_databases]]
binding = "DB"
database_name = "XXXXX-db-local"
database_id = "123"

[[env.preview.d1_databases]]
binding = "DB"
database_name = "XXXXX-db-preview"
database_id = "XXXXXX"

[[env.production.d1_databases]]
binding = "DB"
database_name = "XXXXX-db"
database_id = "XXXXX"
because I can't set the local values anymore 😦
Walshy
Walshy•2w ago
yeah you'd need to manage that in the dashboard too, for local you'd need to do --d1=xx
dev
dev•2w ago
unfortunately I'm using remix+vite+remixCloudflareDevProxy, so I can't use any CLI options
import {
vitePlugin as remix,
cloudflareDevProxyVitePlugin as remixCloudflareDevProxy,
} from '@remix-run/dev';
import { defineConfig } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';
import { getLoadContext } from './load-context';

export default defineConfig({
plugins: [
remixCloudflareDevProxy({
getLoadContext,
}),
remix({
future: {
v3_fetcherPersist: true,
v3_relativeSplatPath: true,
v3_throwAbortReason: true,
},
}),
tsconfigPaths(),
],
});
import {
vitePlugin as remix,
cloudflareDevProxyVitePlugin as remixCloudflareDevProxy,
} from '@remix-run/dev';
import { defineConfig } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';
import { getLoadContext } from './load-context';

export default defineConfig({
plugins: [
remixCloudflareDevProxy({
getLoadContext,
}),
remix({
future: {
v3_fetcherPersist: true,
v3_relativeSplatPath: true,
v3_throwAbortReason: true,
},
}),
tsconfigPaths(),
],
});
(like any other person running remix on CF)
Want results from more Discord servers?
Add your server