# TypeError: Cannot read properties of undefined (reading 'length')

**URL:** <https://community.prismic.io/t/typeerror-cannot-read-properties-of-undefined-reading-length/14696>\
**Category:** Developing with Prismic\
**Tags:** gatsby\
**Created:** [December 8, 2023, 8:51am UTC](https://community.prismic.io/t/typeerror-cannot-read-properties-of-undefined-reading-length/14696 "2023-12-08T08:51:40Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [December 18, 2023, 11:42am UTC](https://community.prismic.io/t/typeerror-cannot-read-properties-of-undefined-reading-length/14696/7 "2023-12-18T11:42:07Z")

</div>

No unfortunately not. But you can output it as HTML like so:

> [@Rest API as HTML](https://community.prismic.io/t/rest-api-as-html/432/2):
>
> Hi Ken, Welcome to the community grinning You can easily convert the JSON output using the [Prismic DOM](https://github.com/prismicio/prismic-dom). It’s our JS library for doing exactly that. Here’s an example of how to use it in pure JS: var PrismicDOM = require('prismic-dom'); var titleHtml = PrismicDOM.RichText.asHtml(document.data.title, linkResolver) You can see more examples here, we also have examples in many different frameworks: [https://prismic.io/docs/javascript/templating/rich-text#1\_0-output-as-html](https://prismic.io/docs/javascript/templating/rich-text#1_0-output-as-html) Let me know if you…

---

_[View the full topic](https://community.prismic.io/t/typeerror-cannot-read-properties-of-undefined-reading-length/14696)._
