Skip to content
This repository has been archived by the owner on Apr 4, 2022. It is now read-only.

add icons to gatsby-config.js #11

Merged
merged 3 commits into from
Mar 16, 2021
Merged

add icons to gatsby-config.js #11

merged 3 commits into from
Mar 16, 2021

Conversation

frames75
Copy link
Contributor

Building the frontend, when you do:

$ cd frontend
$ npm install
$ npm run develop

This last command returns next error:

> [email protected] develop /home/carpanta/Documentos/Cosas/Curro/nodejs/strapi/temp-pullreq-strapi-starte/strapi-starter-gatsby-blog/frontend
> gatsby develop

success open and validate gatsby-configs - 0.064s

 ERROR #11331  PLUGIN

Invalid plugin options for "gatsby-plugin-manifest":

- "value" must contain at least one of [icon, icons]

not finished load plugins - 0.687s

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] develop: `gatsby develop`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] develop script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/carpanta/.npm/_logs/2020-12-21T16_12_06_775Z-debug.log

The Error is solved by adding to frontend/gatsby-config.js the properties icon and icons.

It's not necessary to add the icons files.


Linux Mint 19.2
Strapi: v3.4.0
Node.js: v14.15.3

@vercel
Copy link

vercel bot commented Dec 21, 2020

@frames75 is attempting to deploy a commit to the Strapi Team on Vercel.

A member of the Team first needs to authorize it.

@frames75 frames75 changed the title add icons gatsby-config add icons to gatsby-config.js Dec 21, 2020
Comment on lines 37 to 48
icons: [
{
src: `src/images/my-icon.png`,
sizes: `48x48`,
type: `image/png`,
},
{
src: `src/images/my-icon.png`,
sizes: `72x72`,
type: `image/png`,
},
],
Copy link
Contributor

@markkaylor markkaylor Mar 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @frames75 thanks for your PR. I think you can remove this array and we can use automatic mode https://www.gatsbyjs.com/plugins/gatsby-plugin-manifest/#automatic-mode-configuration.

You'll need to add the image in src/images. Could you change the name to favicon.png or default-icon.png

For reference you can see how it is setup on: https://github.com/strapi/strapi-starter-gatsby-catalog/blob/main/frontend/gatsby-config.js

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's perfect.

I changed the icon parameter to icon: 'src/images/favicon.png' and added the src/images/favicon.png, obtained from the strapi-starter-gatsby-catalog.

@vercel
Copy link

vercel bot commented Mar 15, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/strapijs/strapi-starter-gatsby-blog/ANVsycrh9pBPzDbfFebSYLN6dQcn
✅ Preview: https://strapi-starter-git-fork-frames75-error-gatsby-config-ico-96d026.vercel.app

@@ -32,6 +32,8 @@ module.exports = {
background_color: "#663399",
theme_color: "#663399",
display: "minimal-ui",

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but could you please remove this space 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Best regards.

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

Successfully merging this pull request may close these issues.

2 participants