# Build failure when instagram/vimeo posts no longer exist

**URL:** <https://discourse.gohugo.io/t/build-failure-when-instagram-vimeo-posts-no-longer-exist/27148>\
**Category:** support\
**Created:** [July 25, 2020, 6:49am UTC](https://discourse.gohugo.io/t/build-failure-when-instagram-vimeo-posts-no-longer-exist/27148 "2020-07-25T06:49:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![apolaine](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/apolaine/32/9188_2.png) [@apolaine](https://discourse.gohugo.io/u/apolaine)\
**Post date:** [July 25, 2020, 6:49am UTC](https://discourse.gohugo.io/t/build-failure-when-instagram-vimeo-posts-no-longer-exist/27148/1 "2020-07-25T06:49:10Z")

</div>

I’ve read a couple of other threads about this error, but I seem to have a different problem. I have a custom shortcode in my /layouts/shortcodes folder for Instagram and Vimeo so that they run when offline, but when online use the internal one:

```auto
 {{ if not .Site.IsServer }}
    {{ template "_internal/shortcodes/instagram.html" . }}
    {{ else }}
    <!-- Render the placeholder for the shortcode -->
    <pre>Instagram Photo: {{ .Get 0 }}</pre>
    {{ end }}
```

But now I get the build errors on Netlify when I deploy:

```auto
ERROR 2020/07/25 06:30:22 Failed to get JSON resource "https://vimeo.com/api/oembed.json?url=https://vimeo.com/1496857": Failed to retrieve remote file: Not Found

8:30:23 AM: ERROR 2020/07/25 06:30:23 Failed to get JSON resource "https://api.instagram.com/oembed/?url=https://www.instagram.com/p/BqxGoy1gGPI/&amp;maxwidth=640&amp;omitscript=true": Failed to retrieve remote file: Not Found
```

I checked those two Instagram and Vimeo posts and they no longer exists. That’s okay, I can remove them from my blog post, but that’s not very robust. I’d prefer the posts just to show a dud embed than the build to fail.

Any ideas?

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [July 25, 2020, 5:27pm UTC](https://discourse.gohugo.io/t/build-failure-when-instagram-vimeo-posts-no-longer-exist/27148/2 "2020-07-25T17:27:11Z")

</div>

> <https://github.com/gohugoio/hugo/issues/7228>
>
> As suggested in #5643 I am creating a new issue for this.
> getJSON causes builds to fail and halt in the versions...

---

<div class="post-metadata">

**Author:** ![apolaine](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/apolaine/32/9188_2.png) [@apolaine](https://discourse.gohugo.io/u/apolaine)\
**Post date:** [July 25, 2020, 9:00pm UTC](https://discourse.gohugo.io/t/build-failure-when-instagram-vimeo-posts-no-longer-exist/27148/3 "2020-07-25T21:00:24Z")

</div>

Ah, okay, thanks.
