- 
                Notifications
    You must be signed in to change notification settings 
- Fork 10.3k
Closed
Description
Description
When running the plugin with no icons property in the options (only icon for the source image), gatsby build throws a build error.
Error: Cannot read property '0' of undefined
  - render-page.js:22888 Object.exports.onRenderBody
    render-page.js:22888:24
Steps to reproduce
- Configure gatsby-plugin-manifestas described in Automatic Mode
- Run gatsby build
Expected result
The plugin should use the defaultIcons from:
gatsby/packages/gatsby-plugin-manifest/src/gatsby-node.js
Lines 6 to 47 in 362f78a
| const defaultIcons = [ | |
| { | |
| "src": `icons/icon-48x48.png`, | |
| "sizes": `48x48`, | |
| "type": `image/png`, | |
| }, | |
| { | |
| "src": `icons/icon-72x72.png`, | |
| "sizes": `72x72`, | |
| "type": `image/png`, | |
| }, | |
| { | |
| "src": `icons/icon-96x96.png`, | |
| "sizes": `96x96`, | |
| "type": `image/png`, | |
| }, | |
| { | |
| "src": `icons/icon-144x144.png`, | |
| "sizes": `144x144`, | |
| "type": `image/png`, | |
| }, | |
| { | |
| "src": `icons/icon-192x192.png`, | |
| "sizes": `192x192`, | |
| "type": `image/png`, | |
| }, | |
| { | |
| "src": `icons/icon-256x256.png`, | |
| "sizes": `256x256`, | |
| "type": `image/png`, | |
| }, | |
| { | |
| "src": `icons/icon-384x384.png`, | |
| "sizes": `384x384`, | |
| "type": `image/png`, | |
| }, | |
| { | |
| "src": `icons/icon-512x512.png`, | |
| "sizes": `512x512`, | |
| "type": `image/png`, | |
| }, | |
| ] | 
...and
- generate the default set of images
- populate the iconsproperty of themanifest.jsonwith the default icons
Actual result
Build throws error:
Error: Cannot read property '0' of undefined
  - render-page.js:22888 Object.exports.onRenderBody
    render-page.js:22888:24
Environment
- Gatsby version (npm list gatsby): 1.9.246
- gatsby-cli version (gatsby --version): 1.9.246
- Node.js version: v8.11.0
- Operating System: macOS 10.13.4
File contents (if changed):
gatsby-config.js:
    {
      resolve: 'gatsby-plugin-manifest',
      options: {
        name: pkg.title,
        short_name: pkg.shortName,
        start_url: '/',
        background_color: '#DFE7F7',
        theme_color: '#00A3DB',
        display: 'minimal-ui',
        icon: 'src/icon.png',
      },
    },
    'gatsby-plugin-offline',Metadata
Metadata
Assignees
Labels
No labels