zzossig / hugo-theme-zzo

Make a blog with hugo zzo theme!
https://themes.gohugo.io//theme/hugo-theme-zzo/en/
MIT License
737 stars 257 forks source link

Failed to get JSON resource #239

Closed WilliamLee990805 closed 4 years ago

WilliamLee990805 commented 4 years ago

Hi zzo, Unfortunately, I encounter this issue when building Hugo server. $ hugo server Building sites … ERROR 2020/03/28 01:39:01 Failed to get JSON resource "https://api.instagram.com/oembed/?url=https://www.instagram.com/p/BGvuInzyFAe/&maxwidth=640&omitscript=true": Get "https://api.instagram.com/oembed/?url=https://www.instagram.com/p/BGvuInzyFAe/&maxwidth=640&omitscript=true": dial tcp 31.13.74.1:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ERROR 2020/03/28 01:39:22 Failed to get JSON resource "https://api.twitter.com/1/statuses/oembed.json?id=1085870671291310081&omit_script=true": Get "https://api.twitter.com/1/statuses/oembed.json?id=1085870671291310081&omit_script=true": dial tcp 69.171.225.13:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ERROR 2020/03/28 01:39:43 Failed to get JSON resource "https://vimeo.com/api/oembed.json?url=https://vimeo.com/48912912": Get "https://vimeo.com/api/oembed.json?url=https://vimeo.com/48912912": dial tcp 67.228.37.26:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. Built in 66789 ms Error: Error building site: logged 3 error(s)

camilomarquez commented 4 years ago

check u internet connection

zzossig commented 4 years ago

I don't know what https://api.instagram.com/oembed/ is. I think you added it to your blog. So that means, you have to solve it by yourself and this is not related to this project.

iColdPlayer commented 4 years ago

@zzossig I do facing the same issue here.

The issue is from rich-content.md post, there's an embed video from Vimeo {{< vimeo_simple 48912912 >}}

The GET API from Vimeo doesn't work in assets/lib/reveal/reveal.js and causing an error.

// Vimeo frames must include "?api=1"
_appendParamToIframeSource('src', 'player.vimeo.com/', 'api=1');
_appendParamToIframeSource('data-src', 'player.vimeo.com/', 'api=1');

// Vimeo postMessage API
toArray(element.querySelectorAll('iframe[src*="player.vimeo.com/"]')).forEach(function (el) {
  if (!el.hasAttribute('data-ignore') && el.contentWindow && typeof el.contentWindow.postMessage === 'function') {
    el.contentWindow.postMessage('{"method":"pause"}', '*');
  }
});

Here's my terminal looks like:

ERROR 2020/07/01 23:27:19 "/home/icoldplayer/Documents/static/new-docs/content/en/posts/rich-content.md:1:1": 
timed out initializing value. This is most likely a circular loop in a shortcode

ERROR 2020/07/01 23:27:26 Failed to get JSON resource "https://vimeo.com/api/oembed.json?url=https://vimeo.com/48912912":
Get https://vimeo.com/api/oembed.json?url=https://vimeo.com/48912912: dial tcp 36.86.63.185:443: connect: connection refused

Just remove the shortcodes in the post or comment on the code above, and everything works perfectly. Thanks!

camilomarquez commented 4 years ago

Ty! I had the same problem with this site. I found problems running locally in 3 of 4 pc, with diferent versions of hugo..a fast solution for me was delete all rich-content.md. I had error with twitter and youtube too.