# Prismicio/helpers asText, asHTML typescript typing error

**URL:** <https://community.prismic.io/t/prismicio-helpers-astext-ashtml-typescript-typing-error/9050>\
**Category:** Developing with Prismic\
**Tags:** javascript\
**Created:** [February 14, 2022, 4:57pm UTC](https://community.prismic.io/t/prismicio-helpers-astext-ashtml-typescript-typing-error/9050 "2022-02-14T16:57:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![cptflammin](https://avatars.discourse-cdn.com/v4/letter/c/eada6e/32.png) [@cptflammin](https://community.prismic.io/u/cptflammin)\
**Post date:** [February 14, 2022, 4:57pm UTC](https://community.prismic.io/t/prismicio-helpers-astext-ashtml-typescript-typing-error/9050/1 "2022-02-14T16:57:58Z")

</div>

There is a TS typing error when using asText(), asHTML() on a expected rich text field

prismicH.asText(this.\_blogPost.title)

> Argument of type 'any' is not assignable to parameter of type ' | [RTNode, ...RTNode]'.Type 'any' is not assignable to type '[RTNode, ...RTNode]'.Source provides no match for required element at position 0 in target.

The current workaround is to use "as any" to remove the error:

prismicH.asText(this.\_blogPost.title **as any** )

---

<div class="post-metadata">

**Author:** ![Priyanka](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/priyanka/32/3223_2.png) [@Priyanka](https://community.prismic.io/u/Priyanka)\
**Post date:** [February 15, 2022, 9:18am UTC](https://community.prismic.io/t/prismicio-helpers-astext-ashtml-typescript-typing-error/9050/3 "2022-02-15T09:18:02Z")

</div>

Hello Nicolas,

I'm not sure why you are getting this error. So I'm going to reach out to the team to get more information.

Thanks,  
Priyanka

---

<div class="post-metadata">

**Author:** ![Priyanka](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/priyanka/32/3223_2.png) [@Priyanka](https://community.prismic.io/u/Priyanka)\
**Post date:** [February 16, 2022, 3:24am UTC](https://community.prismic.io/t/prismicio-helpers-astext-ashtml-typescript-typing-error/9050/5 "2022-02-16T03:24:39Z")

</div>

Hello @cptflammin

1. Can you try updating `@prismicio/types` within your project and try again?
2. Can you provide a minimal reproduction?
3. Can you share with us your dependencies version? (package.json)

Thanks,  
Priyanka

---

<div class="post-metadata">

**Author:** ![cptflammin](https://avatars.discourse-cdn.com/v4/letter/c/eada6e/32.png) [@cptflammin](https://community.prismic.io/u/cptflammin)\
**Post date:** [February 18, 2022, 1:00pm UTC](https://community.prismic.io/t/prismicio-helpers-astext-ashtml-typescript-typing-error/9050/6 "2022-02-18T13:00:28Z")

</div>

Hello, thx for reply, feedback, not running better 😕

1. Done: npm install --save-dev @prismicio/types@0.1.25 --color=always

import \* as prismicH from '@prismicio/helpers'  
`

{ prismicH.asText(this.\_blogPost.excerpt) }

`

"excerpt": [  
{  
"type": "paragraph",  
"text": "March, April,May, it is time to rediscover these incredible European destinations for a budget. The wait is over !",  
"spans":   
}  
],

Argument of type 'any' is not assignable to parameter of type ' | [RTNode, ...RTNode]'.Type 'any' is not assignable to type '[RTNode, ...RTNode]'.Source provides no match for required element at position 0 in target.

I am using StenciJS (www standard web component compiler) and coding in TS

"prismic-dom": "^2.2.7",  
"@prismicio/client": "^6.3.0",  
"@prismicio/helpers": "^2.1.1",  
"apollo-cache-inmemory": "^1.6.6",  
"apollo-client": "^2.6.10",  
"apollo-link-prismic": "^1.0.9",

---

<div class="post-metadata">

**Author:** ![Priyanka](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/priyanka/32/3223_2.png) [@Priyanka](https://community.prismic.io/u/Priyanka)\
**Post date:** [February 22, 2022, 3:10am UTC](https://community.prismic.io/t/prismicio-helpers-astext-ashtml-typescript-typing-error/9050/7 "2022-02-22T03:10:03Z")

</div>

Hello @cptflammin

Sorry for the delayed response; I was out of the office. I am following up with the team and will come back to you as they reply.

Thanks,  
Priyanka

---

<div class="post-metadata">

**Author:** ![Priyanka](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/priyanka/32/3223_2.png) [@Priyanka](https://community.prismic.io/u/Priyanka)\
**Post date:** [February 22, 2022, 9:50am UTC](https://community.prismic.io/t/prismicio-helpers-astext-ashtml-typescript-typing-error/9050/8 "2022-02-22T09:50:25Z")

</div>

Hello @cptflammin

Our dedicated team member is not sure about your exact context. You might need to type their "excerpt" property as apparently, and Stencil is typing it as `any[],` which is inaccurate. To do so, you can `import { RichTextField } from "@prismicio/types"` and use this type to type their excerpt prop/property.

But still, It doesn't solve your issue. It would be great to share proper context to troubleshoot it better.

Thanks,  
Priyanka

---

<div class="post-metadata">

**Author:** ![webadmin](https://avatars.discourse-cdn.com/v4/letter/w/90db22/32.png) [@webadmin](https://community.prismic.io/u/webadmin)\
**Post date:** [August 31, 2022, 10:03pm UTC](https://community.prismic.io/t/prismicio-helpers-astext-ashtml-typescript-typing-error/9050/10 "2022-08-31T22:03:06Z")

</div>

I am having same issue.

I've made a [post for my issue.](https://community.prismic.io/t/type-error-when-building-package-that-uses-prismicio-helpers/10938)
