alexluong / gatsby-packages

Gatsby packages
MIT License
56 stars 24 forks source link

Cannot read property 'apiKey' of undefined #32

Open hrishikesh-k opened 4 years ago

hrishikesh-k commented 4 years ago

Hello, I was just trying to setup this plugin for my project, but, can't get past the gatsby-config.js phase.

I've added the plugin in my gatsby-config.js like this:

module.exports =
  {
    plugins: [
      {
        resolve: `gatsby-plugin-firebase`,
        options:
          {
            credentials:
              {
                apiKey: `value`,
                authDomain: `value`,
                databaseURL: `value`,
                projectId: `value`,
                storageBucket: `value`,
                messagingSenderId: `value`,
                appId: `value`
              }
          }
      },
  }

with the respective values from the config Firebase gave my app. However, when I run gatsby develop in console, I get:

"gatsby-plugin-firebase" threw an error while running the onCreateWebpackConfig lifecycle:

Cannot read property 'apiKey' of undefined

  2 |   const {
  3 |     credentials: {
> 4 |       apiKey,
    |       ^
  5 |       authDomain,
  6 |       databaseURL,
  7 |       projectId,

File: node_modules\gatsby-plugin-firebase\gatsby-node.js:4:7

This seemed to me like the easiest step, but, has kept me puzzled already. I'm using "gatsby-plugin-firebase": "^0.2.0-beta.4", by the way.

perriea commented 4 years ago

Same issue ...