From 2d6bcebc5a98e947450be734cc7b0f28fde2bfc9 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Wed, 9 Jul 2025 14:59:19 +0200 Subject: [PATCH] Add note about quoting in configuration guide The way Nuxt handles environment variables is weird. Document this to help others from not falling into its pitfalls. --- docs/admin/config.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/admin/config.md b/docs/admin/config.md index 8e61c75..e273f7d 100644 --- a/docs/admin/config.md +++ b/docs/admin/config.md @@ -4,6 +4,10 @@ --> # Configuration +## Quoting + +Environment variables are parsed using [destr](https://github.com/unjs/destr) which contain arbitrary unspecified and undocumented rules for converting strings to data. If an environment input looks like JSON it'll most likely be parsed as JSON and my cause a type missmatch error to be reported. To avoid strings being converted into other unintended values put the value into `"` marks. Depending on your configuration environment you may have to double up the quotation marks and/or use escapes. + ## Environment Variables ### NUXT_SESSION_ROTATES_TIMEOUT