jbolda / gatsby-source-airtable

MIT License
216 stars 43 forks source link

Error at build time: tables is not defined for gatsby-source-airtable #174

Closed jibe-b closed 4 years ago

jibe-b commented 4 years ago

Hi! I'm looking forward to displaying data collected through airtable but for the moment I get an error at build time.

I pass the api key in the command line AIRTABLE_API_KEY=MyAPIkey gatsby develop

and here is the part of my gatsby-config.jsthat deals with the plugin:

  `gatsby-source-airtable`,
  {
    resolve: `gatsby-source-airtable`,
    options: {
      apiKey: process.env.AIRTABLE_API_KEY,
      concurrency: 5,
      tables: [
        {
          baseId: `appuuuieuieuieuieu`,
          tableName: `A magnificient table`,
        },
      ]
    }
  }

but I get the error message tables is not defined for gatsby-source-airtable in gatsby-config.js

Configuration:

Thanks a lot for your help!

jbolda commented 4 years ago

👋

Is this copied directly out of your config? When you define a plugin in the config, you either use a string (if no options are needed) or you use an object with resolve: `gatsby-source-airtable`. It appears you may have used both in the snippet above. It processes these in order, and the first gatsby-source-airtable that it sees is the string version which does not have the options defined.

jibe-b commented 4 years ago

Hi @jbolda, first of all thank you for teaching me something I didn't know. I removed the line without the options defined.

Now the plugin throws an error but without any error message.


"gatsby-source-airtable" threw an error while running the sourceNodes lifecycle:

  

warn The gatsby-source-airtable plugin has generated no Gatsby nodes. Do you need it?

What should I output in debug mode to help identifying where the plugin fails?

jbolda commented 4 years ago

It will throw errors as they surface. It doesn't have a special debug mode currently. I would recommend checking out the examples potentially.

In the config that you initially shared, using the / before the backtick is curious. Is that from copying and pasting?

jibe-b commented 4 years ago

Thank you for your answer. I added the backslashes after-copy-pasting because markdown was broken, but it was not needed.

The examples do not show much more. I will investigate.

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had any recent activity for 30 days. It will be closed if no further activity occurs within 7 days. Remove stale label, comment, and/or apply "ongoing issue" label to prevent this from being closed. Thank you for your contributions.