Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.

Commit 7b20e13

Browse files
docs: add note about runtime config serialization (#8432)
Co-authored-by: Daniel Roe <daniel@roe.dev>
1 parent 6bcd9cd commit 7b20e13

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/content/2.guide/4.going-further/10.runtime-config.md

+6
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ console.log(runtimeConfig.public.apiBase)
3939
When using Options API the public runtime config is available via `this.$config.public`.
4040
::
4141

42+
### Serialization
43+
44+
Your runtime config will be serialized before being passed to Nitro. This means that anything that cannot be serialized and then deserialized (such as functions, Sets, Maps, and so on), should not be set in your `nuxt.config`.
45+
46+
Instead of passing non-serializable objects or functions into your application from your `nuxt.config`, you can place this code in a Nuxt or Nitro plugin or middleware.
47+
4248
### Environment Variables
4349

4450
The most common way to provide configuration is by using [Environment Variables](https://medium.com/chingu/an-introduction-to-environment-variables-and-how-to-use-them-f602f66d15fa).

0 commit comments

Comments
 (0)