---
title: "NUXT_B3015"
description: "Non-serializable prop on a server component"
canonical_url: "https://nuxt-git-renovate-h3-2x-nuxt-js.vercel.app/docs/4.x/errors/b3015"
---
# B3015

A template passes a function, a class or a class instance (such as `new Date()`) as a prop to a server component, or in the `props` or `context` of a `<NuxtIsland>`. Props of a server component are serialized as JSON and sent to the server to render it, so these values cannot reach the component intact.

This warning is reported unless [`experimental.templateDiagnostics`](https://nuxt-git-renovate-h3-2x-nuxt-js.vercel.app/docs/4.x/guide/going-further/experimental-features#templatediagnostics) is disabled. Only values that can be seen in the template are checked: inline functions, `new` expressions, and functions or classes declared at the top level of `<script setup>`.

## Resolution

Pass only JSON-serializable values (strings, numbers, booleans, `null`, arrays and plain objects), and move the logic that needs the function into the server component:

```diff [app/pages/index.vue]
 <template>
-  <PriceTag :format="value => `$${value}`" :value="price" />
+  <PriceTag currency="USD" :value="price" />
 </template>
```

If the component needs a function from its parent, render it on the client instead of as a server component.

::read-more{to="https://nuxt-git-renovate-h3-2x-nuxt-js.vercel.app/docs/4.x/guide/concepts/server-components"}
::


## Sitemap

See the full [sitemap](https://nuxt-git-renovate-h3-2x-nuxt-js.vercel.app/sitemap.md) for all pages.
