Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

400: could not publish request to the RealFaviconGenerator API. #36

Closed
webchaz opened this issue Mar 28, 2015 · 11 comments
Closed

400: could not publish request to the RealFaviconGenerator API. #36

webchaz opened this issue Mar 28, 2015 · 11 comments
Labels

Comments

@webchaz
Copy link

webchaz commented Mar 28, 2015

According to their docs we need an api_key, but I don't see an api_key config option. I'm not sure if this is the issue here exactly, but the error above is what's being returned.

@dmnsgn
Copy link
Contributor

dmnsgn commented Mar 30, 2015

Creating my API key and changing it directly into the configuration json had no effect in my case.

@haydenbleasel
Copy link
Contributor

@phbernard Any ideas matey?

@jamesryanbell
Copy link

FYI: This only seems to be an issue when inline images are used, if you pass an image URL then the script works correctly.

@haydenbleasel
Copy link
Contributor

@jamesryanbell Ahh okay. The module inlines images automatically so we'll need to allow inline images too.

@phbernard
Copy link
Contributor

Not sure to understand what's wrong. Do you have an error message with the 400 itself?

I realize the API gives the message along with the status. Some HTTP libs don't return it because it's not in the response body. @haydenbleasel, could it help if the API would return a JSON document, along with the 400? (the error case described in the interactive API).

@bjornreppen
Copy link

Trying to run via node with:

var favicons = require('favicons');
var options = { files: { src: './src/img/logo.png', dest: './build/' } };
favicons(options);

but getting: 400: could not publish request to the RealFaviconGenerator API.

@jessehattabaugh
Copy link
Contributor

I get this error when calling like so;

var config = {};
config.srcPath = path.join(__dirname, srcDir);
config.destPath = path.join(__dirname, destDir);

favicons({
    files: {
      src: path.join(config.srcPath, 'favicon.png'),
      dest: config.destPath
    },
    icons: {
      opengraph: false
    }
  }, function (error, metadata) {
    if(error) {
      console.error(error);
    }
    console.log('favicon task finished');
  });

@jessehattabaugh
Copy link
Contributor

Also fails if I inline the base64 data myself like so

var iconFile = path.join(config.srcPath, 'favicon.png');
  fs.readFile(iconFile, function (err, data) {
    favicons({
      files: {
        src: path.join(config.srcPath, 'favicon.png'),
        dest: config.destPath
      },
      icons: {
        opengraph: false
      },
      favicon_generation: {
        master_picture: {
          type: 'inline',
          content: new Buffer(data).toString('base64')
        }
      }
    }, function (error, metadata) {
      if(error) {
        console.error(error);
      }
      console.log('favicon task finished');
    });
  });

@jessehattabaugh
Copy link
Contributor

adding an api_key didn't help

@brianberlin
Copy link
Contributor

In my case, I got this error because the png i was trying to use was not large enough. Since the callback doesn't send back the original error message, its difficult to troubleshoot.

@haydenbleasel
Copy link
Contributor

@webchaz @dmnsgn @jamesryanbell @mashi @jessehattabaugh @phbernard @brianberlin Hey all, I'm merging this issue into Favicons 4.0. I'd love for you to join in the discussion: #51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants