-
-
Notifications
You must be signed in to change notification settings - Fork 764
Open
Labels
Description
Environment
Nitro: 3.0.1-alpha.1
Bun: 1.3.3
Reproduction
https://github.com/MickL/nitro-env-boolean
Describe the bug
I noticed that when using booleans in runtiemConfig it works:
export default defineConfig({
serverDir: "./",
runtimeConfig: {
a: false,
b: false,
}
});But when they get overwritten from .env they become a string:
.env
NITRO_B=falsehandler
import {defineHandler} from "nitro/h3";
import {useRuntimeConfig} from "nitro/runtime-config";
export default defineHandler((event) => {
const config = useRuntimeConfig();
return {
a: config.a, // boolean
b: config.b, // string
}
});