JakeT
JakeT
NNuxt
Created by JakeT on 4/25/2025 in #❓・help
Multi Line Runtime Config from Env
I am trying to load a certificate from runtime config. It works fine locally (windows), but when i deploy it (dockerized) the runtime config value is set to empty string.
nuxt.config.js
export default defineNuxtConfig({
...
runtimeConfig: {
pg: {
ssl: {
ca: ''
}
}
}
...
})
nuxt.config.js
export default defineNuxtConfig({
...
runtimeConfig: {
pg: {
ssl: {
ca: ''
}
}
}
...
})
.env
NUXT_PG_SSL_CA="-----BEGIN CERTIFICATE-----
...
...
...
-----END CERTIFICATE-----"
.env
NUXT_PG_SSL_CA="-----BEGIN CERTIFICATE-----
...
...
...
-----END CERTIFICATE-----"
console.log({ config: useRuntimeConfig().pg }) local:
{ pg: { ssl: { ca: '-----BEGIN CERTIFICATE-----...' }}}
{ pg: { ssl: { ca: '-----BEGIN CERTIFICATE-----...' }}}
production:
{ pg: { ssl: { ca: '' }}}
{ pg: { ssl: { ca: '' }}}
9 replies