question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't get it running

See original GitHub issue

Hello,

This looks super helpful. I’m trying to get it going.

I created something from scratch using: gatsby new reactTest Then I edited the config.js and added:

  • my access token, and for the file ID,
  • for the id from the Figma URL I get when I open the sketch in the browser: TV9yeRhO…

When I run the example from the documentation:

module.exports = {
  siteMetadata: {
    title: `Gatsby Default Starter`,
    description: `Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need.`,
    author: `@gatsbyjs`,
  },
  plugins: [
  {
    resolve: `gatsby-source-figma`,
    options: {
      // For files:
      //fileId: `TV9yeRhO....`,
      // For projects:
      projectId: `TV9yeRhO....`,
      // Get an access token from Figma Account Settings.
      accessToken: `XXXXX-XXXX0137-6a01-4b4a-a85c-04b5ac88d0d7`,
    },
  },
],
  plugins: [
    `gatsby-plugin-react-helmet`,
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `images`,
        path: `${__dirname}/src/images`,
      },
    },
    `gatsby-transformer-sharp`,
    `gatsby-plugin-sharp`,
    {
      resolve: `gatsby-plugin-manifest`,
      options: {
        name: `gatsby-starter-default`,
        short_name: `starter`,
        start_url: `/`,
        background_color: `#663399`,
        theme_color: `#663399`,
        display: `minimal-ui`,
        icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site.
      },
    },
    // this (optional) plugin enables Progressive Web App + Offline functionality
    // To learn more, visit: https://gatsby.dev/offline
    // `gatsby-plugin-offline`,
  ],
}

I get this error:

{
  "errors": [
    {
      "message": "Cannot query field \"allFigmaDocument\" on type \"Query\".",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "stack": [
        "GraphQLError: Cannot query field \"allFigmaDocument\" on type \"Query\".",
        "    at Object.Field (C:\\reactTest2\\node_modules\\graphql\\validation\\rules\\FieldsOnCorrectType.js:64:31)",
        "    at Object.enter (C:\\reactTest2\\node_modules\\graphql\\language\\visitor.js:334:29)",
        "    at Object.enter (C:\\reactTest2\\node_modules\\graphql\\language\\visitor.js:385:25)",
        "    at visit (C:\\reactTest2\\node_modules\\graphql\\language\\visitor.js:252:26)",
        "    at validate (C:\\reactTest2\\node_modules\\graphql\\validation\\validate.js:63:22)",
        "    at C:\\reactTest2\\node_modules\\express-graphql\\dist\\index.js:154:52",
        "    at process._tickCallback (internal/process/next_tick.js:68:7)"
      ]
    }
  ]
}

Any idea how to fix that? Could it be due to the fact that I installed gatsby-source-figma via yarn, but my gatsby prefers npm as package manager?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
daimzcommented, May 1, 2019

I’m getting the same error that @imehr has.

Seems if I include multiple plugins like @leshokunin did in his example the error goes away:

plugins: [
    {
      resolve: 'gatsby-source-figma',
      options: figmaConfig,
    },
  ],
  plugins: [
    'gatsby-transformer-remark',
    'gatsby-transformer-sharp',
    'gatsby-plugin-react-helmet',
    'gatsby-plugin-sharp',
    {
      resolve: 'gatsby-source-contentful',
      options: contentfulConfig,
    }
  ],

But then the plugin is not used and when I do:

  plugins: [
    'gatsby-transformer-remark',
    'gatsby-transformer-sharp',
    'gatsby-plugin-react-helmet',
    'gatsby-plugin-sharp',
    {
      resolve: 'gatsby-source-contentful',
      options: contentfulConfig,
    },
    {
      resolve: 'gatsby-source-figma',
      options: figmaConfig,
    },
  ],

I get the error:

error UNHANDLED REJECTION
  Error: Schema must contain uniquely named types but contains multiple types named "FigmaDOCUMENTPagesChildrenChildrenChildrenChildrenChildrenBackgroundColor".
0reactions
imehrcommented, Apr 24, 2019

It is the latest version of gatsby (2.5.9). I did another setup today with default gatsby blog . The blog works properly, as soon I I install Figma plugin I get this new error:

----:my-blog-starter ----$ gatsby develop success open and validate gatsby-configs — 0.012 s success load plugins — 1.111 s success onPreInit — 0.003 s success initialize cache — 0.016 s success copy gatsby files — 0.060 s warning gatsby-plugin-feed was initialized in gatsby-config.js without a feeds option. This means that we the plugin will use the internal RSS feed creation, which may not match your use case. This behavior will be removed in the next major release of gatsby-plugin-feed. For more info, check out: https://gatsby.app/adding-rss-feed success onPreBootstrap — 0.009 s success source and transform nodes — 30.090 s error UNHANDLED REJECTION

Error: Schema must contain uniquely named types but contains multiple types named “FigmaDOCUMENTPagesChildrenChildrenChildrenChildrenChildrenChildrenChildrenChildrenChildrenChildrenC hildrenChildrenBackgroundColor”.

----:my-blog-starter ----$

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Is Running So Hard? 16 Ways to Make Running Easier
Sometimes running is hard because your legs feel like lead and you can't get them moving. In this case, your muscles are likely...
Read more >
7 Surprising Reasons You Aren't Getting Better at Running
Many people feel they are slow or just bad at running, and they can't seem to improve despite their best efforts. It's frustrating....
Read more >
How to Run Properly (4 Steps for Beginners to Start Running)
Learn how to run in our step-by-step guide. We'll show you proper running technique so when the zombies come, you don't get eaten....
Read more >
When Does Running Get Easier? - Aaptiv
For most of us, running often feels like a difficult chore—but it doesn't have to be. Make running get easier, and more enjoyable,...
Read more >
How to Get Better at Running When You Can't Run
How to Get Better at Running When You Can't Run · Stretch · Strength Train · Read · Foam Roll · Do Other...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found