# \#javascript

**URL:** https://community.prismic.io/tag/javascript/32.md?page=2

[Latest](https://community.prismic.io/latest.md) · [Categories](https://community.prismic.io/categories.md) · [Tags](https://community.prismic.io/tags.md)

**Page:** 3

---

## [Sync Prismic UI Custom-type to Slice Machine](https://community.prismic.io/t/sync-prismic-ui-custom-type-to-slice-machine/12691)

<div class="topic-metadata">

**Author:** [@poletechnique](https://community.prismic.io/u/poletechnique)\
**Replies:** 1\
**Last updated:** [March 15, 2023, 10:13pm UTC](https://community.prismic.io/t/sync-prismic-ui-custom-type-to-slice-machine/12691 "2023-03-15T22:13:31Z")

</div>

Hello, I have an issue, on my slicemachine local, I have a lot of Custom Types deleted, but on my Prismic UI they are not deleted (status: Live) and I need it . I would like to know, if there is a way to sync custom t…

---

## [Many to many relation in one request](https://community.prismic.io/t/many-to-many-relation-in-one-request/12684)

<div class="topic-metadata">

**Author:** [@vitali.bakhur](https://community.prismic.io/u/vitali.bakhur)\
**Replies:** 1\
**Last updated:** [March 15, 2023, 3:04pm UTC](https://community.prismic.io/t/many-to-many-relation-in-one-request/12684 "2023-03-15T15:04:48Z")

</div>

I have custom types gallery\_page gallery\_category - this has relation to gallery\_page How i can get all gallery\_category which gallery\_page (which related on gallery\_category). I want to create one request but i think…

---

## [Query document and return field types](https://community.prismic.io/t/query-document-and-return-field-types/3050)

<div class="topic-metadata">

**Author:** [@lindsay](https://community.prismic.io/u/lindsay)\
**Replies:** 5\
**Last updated:** [March 15, 2023, 11:52am UTC](https://community.prismic.io/t/query-document-and-return-field-types/3050 "2023-03-15T11:52:57Z")

</div>

Hi, I need to fetch a document and get all the fields values as well as their type (i.e keytext, image, slice, etc) from prismic. Do you know any way to do that? Right now it's up to me to parse the data and figure out …

---

## [Personal Portfolio - WEBGL & Prismic](https://community.prismic.io/t/personal-portfolio-webgl-prismic/12456)

<div class="topic-metadata">

**Author:** [@jeetpatel0070070](https://community.prismic.io/u/jeetpatel0070070)\
**Replies:** 6\
**Last updated:** [February 24, 2023, 4:16pm UTC](https://community.prismic.io/t/personal-portfolio-webgl-prismic/12456 "2023-02-24T16:16:21Z")

</div>

1. Website URL : https://jeetramoliya.in/ 2. A Screenshots of the site : 3. Tech Stack used : (No frameworks used) Pug-template-engine, Prismic, WEBGL, Express, Nginx 4. Industry ( Software ) : Web development …

---

## [New Next.js data fetching convention](https://community.prismic.io/t/new-next-js-data-fetching-convention/12447)

<div class="topic-metadata">

**Author:** [@nick.dueber](https://community.prismic.io/u/nick.dueber)\
**Replies:** 1\
**Last updated:** [February 16, 2023, 4:47pm UTC](https://community.prismic.io/t/new-next-js-data-fetching-convention/12447 "2023-02-16T16:47:49Z")

</div>

Nextjs is migrating towards the built in fetch methods that is replacing getStaticProps and getServerSideProps. When they create the call they specify if the call is cached or not. How is @prismicio/client going to supp…

---

## [Unpublish a page programatically](https://community.prismic.io/t/unpublish-a-page-programatically/12401)

<div class="topic-metadata">

**Author:** [@kolbykruger](https://community.prismic.io/u/kolbykruger)\
**Replies:** 1\
**Last updated:** [February 9, 2023, 6:39pm UTC](https://community.prismic.io/t/unpublish-a-page-programatically/12401 "2023-02-09T18:39:42Z")

</div>

Hi Prismic team, I have a unique project I am working on, one that requires me to programmatically unpublish a page when a certain front-end action has been met. Is this a possibility within Prismic? If not, are there r…

---

## [How to prevent unfetch/undefined data when add or remove a new slice in the same page?](https://community.prismic.io/t/how-to-prevent-unfetch-undefined-data-when-add-or-remove-a-new-slice-in-the-same-page/12340)

<div class="topic-metadata">

**Author:** [@marko.bertonati](https://community.prismic.io/u/marko.bertonati)\
**Replies:** 1\
**Last updated:** [February 6, 2023, 10:47pm UTC](https://community.prismic.io/t/how-to-prevent-unfetch-undefined-data-when-add-or-remove-a-new-slice-in-the-same-page/12340 "2023-02-06T22:47:54Z")

</div>

Hi community! Hope doing greath. I'm trying to improve the code of an application (NextJs) about how storage DATA fetched by Prismic, e.g in a page. Let me give you a quickly example. I'm saving this data in this varia…

---

## [Issue fetching all text using fetchLinks](https://community.prismic.io/t/issue-fetching-all-text-using-fetchlinks/12353)

<div class="topic-metadata">

**Author:** [@nick.dueber](https://community.prismic.io/u/nick.dueber)\
**Replies:** 2\
**Last updated:** [February 6, 2023, 1:12pm UTC](https://community.prismic.io/t/issue-fetching-all-text-using-fetchlinks/12353 "2023-02-06T13:12:07Z")

</div>

I am trying to fetch a rich text field in a content relationship. However I am only getting back the first item in the array. I would like to get the whole array of text back. What can i add to my query in order to get …

---

## [Webhook - delay between the webhook and ref update mechanism](https://community.prismic.io/t/webhook-delay-between-the-webhook-and-ref-update-mechanism/12140)

<div class="topic-metadata">

**Author:** [@client.mail.fe](https://community.prismic.io/u/client.mail.fe)\
**Replies:** 8\
**Last updated:** [January 16, 2023, 3:47am UTC](https://community.prismic.io/t/webhook-delay-between-the-webhook-and-ref-update-mechanism/12140 "2023-01-16T03:47:15Z")

</div>

Hello I have read this article about Prismic Webhook and ISR I implement in my project and I encounter some problem my webhook will trigger when a document is published and when my endpoint receive the webhook, I will …

---

## [prismicH.asHTML() Pug Error - Can not read properties of undefined](https://community.prismic.io/t/prismich-ashtml-pug-error-can-not-read-properties-of-undefined/12144)

<div class="topic-metadata">

**Author:** [@mgcherneski](https://community.prismic.io/u/mgcherneski)\
**Replies:** 5\
**Last updated:** [January 10, 2023, 8:39pm UTC](https://community.prismic.io/t/prismich-ashtml-pug-error-can-not-read-properties-of-undefined/12144 "2023-01-10T20:39:32Z")

</div>

Hello all, I am using Prismic with Express and Pug. I've been trying to render a rich text field which is a part of a slice (called content). I would like to take advantage of the prismic helpers (prismicH.toHTML()) but…

---

## [I deliberately leave Open in new tab unchecked but PrismicLink doesn't respect](https://community.prismic.io/t/i-deliberately-leave-open-in-new-tab-unchecked-but-prismiclink-doesnt-respect/11983)

<div class="topic-metadata">

**Author:** [@andrzej1](https://community.prismic.io/u/andrzej1)\
**Replies:** 9\
**Last updated:** [December 20, 2022, 11:22pm UTC](https://community.prismic.io/t/i-deliberately-leave-open-in-new-tab-unchecked-but-prismiclink-doesnt-respect/11983 "2022-12-20T23:22:33Z")

</div>

I have a Link to web type link with a checkbox Open in new tab unchecked. In the API response there is no attribute to represent this choice. (However, if I check the checkbox it returns a target property) Current behav…

---

## [No documents error in client.getSingle](https://community.prismic.io/t/no-documents-error-in-client-getsingle/11956)

<div class="topic-metadata">

**Author:** [@sunilkumardash9](https://community.prismic.io/u/sunilkumardash9)\
**Replies:** 3\
**Last updated:** [December 12, 2022, 11:42am UTC](https://community.prismic.io/t/no-documents-error-in-client-getsingle/11956 "2022-12-12T11:42:50Z")

</div>

I am trying to create a blog with Next js but the getSingle ( getFirst precisely ) does not return any documents despite having the custom type and path set correctly. I tried to dig a bit. When I tried to fetch from th…

---

## [FetchError: failed, reason: write EPROTO](https://community.prismic.io/t/fetcherror-failed-reason-write-eproto/11926)

<div class="topic-metadata">

**Author:** [@tejas](https://community.prismic.io/u/tejas)\
**Replies:** 2\
**Last updated:** [December 9, 2022, 2:45pm UTC](https://community.prismic.io/t/fetcherror-failed-reason-write-eproto/11926 "2022-12-09T14:45:12Z")

</div>

We are getting errors across website as below: FetchError: request to https://sheetsociety.cdn.prismic.io/api/v2/documents/search?page=1&pageSize=1&access\_token=\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*&ref=Y47CthAAACMARIuw&q=\[\[at(document.type…

---

## [Regan Baker Design](https://community.prismic.io/t/regan-baker-design/11613)

<div class="topic-metadata">

**Author:** [@MichaelVestergaard](https://community.prismic.io/u/MichaelVestergaard)\
**Replies:** 6\
**Last updated:** [November 17, 2022, 12:30pm UTC](https://community.prismic.io/t/regan-baker-design/11613 "2022-11-17T12:30:41Z")

</div>

The new website of Regan Baker Design. Static generated with PHP and custom front-end. Design and concept: https://thebeauxartsdigital.com/ Development: https://iliketoplay.dk/

---

## [Prismic Javascript preview toolbar can't leave preview mode after clicking the cancel button](https://community.prismic.io/t/prismic-javascript-preview-toolbar-cant-leave-preview-mode-after-clicking-the-cancel-button/1622)

<div class="topic-metadata">

**Author:** [@harrisonifeanyichukw](https://community.prismic.io/u/harrisonifeanyichukw)\
**Replies:** 2\
**Last updated:** [October 21, 2022, 1:07pm UTC](https://community.prismic.io/t/prismic-javascript-preview-toolbar-cant-leave-preview-mode-after-clicking-the-cancel-button/1622 "2022-10-21T13:07:03Z")

</div>

Hello guys, I know that prismic uses cookies to process previews. and once in preview, we get the toolbar that sticks at the bottom left side of the screen. The cancel button on this snackbar is meant to automatically l…

---

## [Broken link finder](https://community.prismic.io/t/broken-link-finder/11306)

<div class="topic-metadata">

**Author:** [@jjames.home](https://community.prismic.io/u/jjames.home)\
**Replies:** 0\
**Last updated:** [October 9, 2022, 4:24pm UTC](https://community.prismic.io/t/broken-link-finder/11306 "2022-10-09T16:24:27Z")

</div>

Last year I needed something to find broken links, and I found someone that made a post on here about it. I really want to give credit for that but can't seem to find it. I put it together in an app and would welcome co…

---

## [BUG: Cannot add slices to new or existing documents](https://community.prismic.io/t/bug-cannot-add-slices-to-new-or-existing-documents/11288)

<div class="topic-metadata">

**Author:** [@rohan](https://community.prismic.io/u/rohan)\
**Replies:** 2\
**Last updated:** [October 6, 2022, 10:40pm UTC](https://community.prismic.io/t/bug-cannot-add-slices-to-new-or-existing-documents/11288 "2022-10-06T22:40:38Z")

</div>

I am unable to add any new slices to any existing or new documents. When I click on the slice I want to add, there is a console error. However, when I save the document, leave and return, the slice appears as normal. He…

---

## [Fulltext search documents with documents with content relationships to other documents?](https://community.prismic.io/t/fulltext-search-documents-with-documents-with-content-relationships-to-other-documents/11243)

<div class="topic-metadata">

**Author:** [@geoffyuen](https://community.prismic.io/u/geoffyuen)\
**Replies:** 1\
**Last updated:** [October 3, 2022, 8:47pm UTC](https://community.prismic.io/t/fulltext-search-documents-with-documents-with-content-relationships-to-other-documents/11243 "2022-10-03T20:47:12Z")

</div>

I have a Nuxt site with typical Page documents. I've made a Slice component that pulls and displays content from documents (content type of Page\_Parts) chosen from content relationship fields -- so technically a Page doe…

---

## [Prismicio/helpers asText, asHTML typescript typing error](https://community.prismic.io/t/prismicio-helpers-astext-ashtml-typescript-typing-error/9050)

<div class="topic-metadata">

**Author:** [@cptflammin](https://community.prismic.io/u/cptflammin)\
**Replies:** 6\
**Last updated:** [August 31, 2022, 10:03pm UTC](https://community.prismic.io/t/prismicio-helpers-astext-ashtml-typescript-typing-error/9050 "2022-08-31T22:03:06Z")

</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 …

---

## [Cannot access private repo with permanent master+releases token](https://community.prismic.io/t/cannot-access-private-repo-with-permanent-master-releases-token/10408)

<div class="topic-metadata">

**Author:** [@ecommerce-team](https://community.prismic.io/u/ecommerce-team)\
**Replies:** 4\
**Last updated:** [July 4, 2022, 8:46am UTC](https://community.prismic.io/t/cannot-access-private-repo-with-permanent-master-releases-token/10408 "2022-07-04T08:46:47Z")

</div>

The following code works just fine on my public repos, but it won't work on my private repos with a master+releases permanent access token and I'm unclear as to why. const client = prismic.createClient(repos\[repo\], { …

---

## [HTML escaped when using asHTML() for rich text field](https://community.prismic.io/t/html-escaped-when-using-ashtml-for-rich-text-field/10279)

<div class="topic-metadata">

**Author:** [@steve1](https://community.prismic.io/u/steve1)\
**Replies:** 6\
**Last updated:** [June 20, 2022, 2:20am UTC](https://community.prismic.io/t/html-escaped-when-using-ashtml-for-rich-text-field/10279 "2022-06-20T02:20:36Z")

</div>

I am attempting to use Prismic with Astro, and within a template to render a rich text field. using @prismicio/helpers and .asHTML(). However, what is happening is that the html tags in the output are escaped, so they ar…

---

## [Serve prismic.js gzipped](https://community.prismic.io/t/serve-prismic-js-gzipped/4299)

<div class="topic-metadata">

**Author:** [@teamgi](https://community.prismic.io/u/teamgi)\
**Replies:** 19\
**Last updated:** [April 26, 2022, 10:30am UTC](https://community.prismic.io/t/serve-prismic-js-gzipped/4299 "2022-04-26T10:30:01Z")

</div>

I noticed that https://static.cdn.prismic.io/prismic.js is not being served using any compression. Can you please change this to serve it compressed. My request headers are set to accept gzip. Google Lighthouse is compla…

---

## [Shareable preview link not showing draft content](https://community.prismic.io/t/shareable-preview-link-not-showing-draft-content/4552)

<div class="topic-metadata">

**Author:** [@andrew.joll](https://community.prismic.io/u/andrew.joll)\
**Replies:** 8\
**Last updated:** [April 22, 2022, 6:07am UTC](https://community.prismic.io/t/shareable-preview-link-not-showing-draft-content/4552 "2022-04-22T06:07:39Z")

</div>

We have a site using the Prismic toolbar, and are able to preview content so long as we are logged into the CMS. According to this documentation it should be possible to share this preview with non-Prismic users. Initia…

---

## [API tags block by CORS](https://community.prismic.io/t/api-tags-block-by-cors/9765)

<div class="topic-metadata">

**Author:** [@vehiposte](https://community.prismic.io/u/vehiposte)\
**Replies:** 5\
**Last updated:** [April 20, 2022, 10:31pm UTC](https://community.prismic.io/t/api-tags-block-by-cors/9765 "2022-04-20T22:31:22Z")

</div>

Hello, When I want to retrieve all the tags via API tags, I get a CORS error. While it works fine on api search. But if I write url directly in my browser no CORS error.

---

## [@prismicio/client - error responses](https://community.prismic.io/t/prismicio-client-error-responses/7781)

<div class="topic-metadata">

**Author:** [@peter2](https://community.prismic.io/u/peter2)\
**Replies:** 3\
**Last updated:** [April 6, 2022, 12:18pm UTC](https://community.prismic.io/t/prismicio-client-error-responses/7781 "2022-04-06T12:18:12Z")

</div>

Does anyone have a good overview on what errors the Prismic.client from @prismicio/client can return in different scenarios such as network outage, server side issues, document issues? I would like to write an error hand…

---

## [Content Relationship predicates matching a specific value](https://community.prismic.io/t/content-relationship-predicates-matching-a-specific-value/9592)

<div class="topic-metadata">

**Author:** [@marco3](https://community.prismic.io/u/marco3)\
**Replies:** 1\
**Last updated:** [April 1, 2022, 12:27pm UTC](https://community.prismic.io/t/content-relationship-predicates-matching-a-specific-value/9592 "2022-04-01T12:27:53Z")

</div>

Hey! I have a question regarding building predicates. I have a custom type productPage which has a group field of Content Relationship to my other custom type articles. So a product can have linked many articles. I'm …

---

## [Prismic.api.query with predicates and ordering](https://community.prismic.io/t/prismic-api-query-with-predicates-and-ordering/9340)

<div class="topic-metadata">

**Author:** [@radekwawrzyk](https://community.prismic.io/u/radekwawrzyk)\
**Replies:** 3\
**Last updated:** [March 17, 2022, 9:28am UTC](https://community.prismic.io/t/prismic-api-query-with-predicates-and-ordering/9340 "2022-03-17T09:28:03Z")

</div>

Hey, currently I'm fetching articles data by prismic.api.query(), however, I have no idea how I could add ordering parameter to that query. My current code: const response = \<PrismicApiResponse\>await $prismic.api.query…

---

## [TTL - searching for replacement for apiDataTTL option](https://community.prismic.io/t/ttl-searching-for-replacement-for-apidatattl-option/9204)

<div class="topic-metadata">

**Author:** [@todd1](https://community.prismic.io/u/todd1)\
**Replies:** 3\
**Last updated:** [March 1, 2022, 5:08pm UTC](https://community.prismic.io/t/ttl-searching-for-replacement-for-apidatattl-option/9204 "2022-03-01T17:08:30Z")

</div>

While porting to the latests Prismic client for Javascript - I've found that the option apiDataTTL is no longer exposed. The default TTL is 5 seconds which is great when optimizing for the freshest data - but I would li…

---

## [How to fetch other documents based on the one relationship](https://community.prismic.io/t/how-to-fetch-other-documents-based-on-the-one-relationship/9059)

<div class="topic-metadata">

**Author:** [@radekwawrzyk](https://community.prismic.io/u/radekwawrzyk)\
**Replies:** 1\
**Last updated:** [February 16, 2022, 5:16am UTC](https://community.prismic.io/t/how-to-fetch-other-documents-based-on-the-one-relationship/9059 "2022-02-16T05:16:56Z")

</div>

Hey! I have a problem regarding fetching data and relationships. Currently I have Article document, where I put Content Relationship field (Author) to make relationship between Author and his Articles. I don't have any…

---

## [VanillaJS ? =\> StencilJS (standards-compliant web component compiler)](https://community.prismic.io/t/vanillajs-stenciljs-standards-compliant-web-component-compiler/8894)

<div class="topic-metadata">

**Author:** [@cptflammin](https://community.prismic.io/u/cptflammin)\
**Replies:** 1\
**Last updated:** [February 2, 2022, 3:34pm UTC](https://community.prismic.io/t/vanillajs-stenciljs-standards-compliant-web-component-compiler/8894 "2022-02-02T15:34:40Z")

</div>

Hi there! In your doc, you mention that VanillaJS project is not recommended and JS frameworks use is strongly recommended. I'd like to challenge this statement as StencilJS.com (a web component compiler) makes it possi…

[Previous page](https://community.prismic.io/tag/javascript/32.md?match_all_tags=true&page=1&tags%5B%5D=javascript)

[Next page](https://community.prismic.io/tag/javascript/32.md?match_all_tags=true&page=3&tags%5B%5D=javascript)
