Skip to content

Gatsby develop with Drupal JSON API fails due to names starting with number #9654

@dasjo

Description

@dasjo

Description

when running gatsby develop, the following name error pops up:

gatsby develop
success open and validate gatsby-config — 0.013 s
success load plugins — 0.289 s
success onPreInit — 1.155 s
success delete html and css files from previous builds — 0.006 s
success initialize cache — 0.081 s
success copy gatsby files — 0.058 s
success onPreBootstrap — 0.020 s
⠁ Starting to fetch data from Drupal
success source and transform nodes — 3.547 s
success building schema — 0.598 s
success createPages — 0.001 s
success createPagesStatefully — 0.031 s
success onPreExtractQueries — 0.004 s
success update schema — 0.394 s
error Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "30A8F5605F194Ff693Aa40C896329D0C_2" does not.

It looks to me this is because the UUID is starting with a number, while graphql requires it to start with a letter.

Steps to reproduce

I tried to follow these instructions to set up a gatsby site based on my existing Drupal site:
https://www.phase2technology.com/blog/drupal-8-gatsbyjs-quickstart

I successfully enabled jsonapi, when running gatsby develop the error pops up.

I don't have everything ready to share just now, but here is the export information of the page manager configuration that refers to the block with the id that seems to cause the issue. I got multiple similar name errors, so I am thinking it doesn't depend on this particular configuration but maybe some steps I am missing?

uuid: 54f6f553-b9f0-4621-be78-dff1e240e6d5
langcode: en
status: true
dependencies:
  config:
    - page_manager.page.davos
  content:
    - 'block_content:basic:7f667a90-50f9-42dd-8b9a-f69958c873bc'
  module:
    - block_content
    - panels
id: davos-panels_variant-0
label: Panels
variant: panels_variant
variant_settings:
  blocks:
    30a8f560-5f19-4ff6-93aa-40c896329d0c:
      id: 'block_content:7f667a90-50f9-42dd-8b9a-f69958c873bc'
      label: 'See you all in Davos'
      provider: block_content
      label_display: '0'
      status: true
      info: ''
      view_mode: full
      region: main
      weight: 0
      uuid: 30a8f560-5f19-4ff6-93aa-40c896329d0c
      context_mapping: {  }
  id: panels_variant
  uuid: 6513dee3-61ff-473b-bc50-72268049af0e
  label: null
  weight: 0
  layout: page_general
  layout_settings: {  }
  page_title: ''
  storage_type: page_manager
  storage_id: davos-panels_variant-0
  builder: standard
page: davos
weight: 0
selection_criteria: {  }
selection_logic: and
static_context: {  }

Expected result

The gatby develop should work. I think that the IDs need to be transformed in a way so that they don't start with a number.

Actual result

The error posted above.

Environment

dasjo$ gatsby info --clipboard

  System:
    OS: macOS 10.14
    CPU: x64 Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 11.0.0 - ~/.nvm/versions/node/v11.0.0/bin/node
    npm: 6.4.1 - ~/.nvm/versions/node/v11.0.0/bin/npm
  Browsers:
    Chrome: 70.0.3538.77
    Firefox: 60.0.2
    Safari: 12.0
  npmPackages:
    gatsby: ^2.0.19 => 2.0.19 
    gatsby-image: ^2.0.15 => 2.0.15 
    gatsby-plugin-manifest: ^2.0.5 => 2.0.5 
    gatsby-plugin-offline: ^2.0.5 => 2.0.5 
    gatsby-plugin-react-helmet: ^3.0.0 => 3.0.0 
    gatsby-plugin-sharp: ^2.0.7 => 2.0.7 
    gatsby-source-drupal: ^3.0.7 => 3.0.7 
    gatsby-source-filesystem: ^2.0.4 => 2.0.4 
    gatsby-transformer-sharp: ^2.1.4 => 2.1.4 
  npmGlobalPackages:
    gatsby-cli: 2.4.4

Thanks for your help and let me know if I can provide more information :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    stale?Issue that may be closed soon due to the original author not responding any more.type: question or discussionIssue discussing or asking a question about Gatsby

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions