Skip to content
This repository was archived by the owner on May 8, 2024. It is now read-only.
This repository was archived by the owner on May 8, 2024. It is now read-only.

NoMethodError `key?' for Contentful::Link - possibly due to contentful releases #163

@colinbull

Description

@colinbull

When running bundle exec middleman contentful we have started getting the following error. Previously the same content has been working but we have just started using contentful releases and I suspect that this is causing an invalid response somehow. However I have since removed the content from a release, unpublished and republished but the issue still persists.

Stack trace

9: from /home/me/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/contentful-2.16.1/lib/contentful/fields_resource.rb:13:in `initialize'
8: from /home/me/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/contentful-2.16.1/lib/contentful/base_resource.rb:18:in `initialize'
7: from /home/me/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/contentful-2.16.1/lib/contentful/base_resource.rb:100:in `hydrate_metadata'
6: from /home/me/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/contentful-2.16.1/lib/contentful/base_resource.rb:100:in `each'
5: from /home/me/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/contentful-2.16.1/lib/contentful/base_resource.rb:101:in `block in hydrate_metadata'
4: from /home/me/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/contentful-2.16.1/lib/contentful/base_resource.rb:101:in `map!'
3: from /home/me/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/contentful-2.16.1/lib/contentful/base_resource.rb:101:in `block (2 levels) in hydrate_metadata'
2: from /home/me/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/contentful-2.16.1/lib/contentful/base_resource.rb:119:in `build_link'
1: from /home/me/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/contentful-2.16.1/lib/contentful/base_resource.rb:119:in `new'


/home/me/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/contentful-2.16.1/lib/contentful/base_resource.rb:12:in `initialize': undefined method `key?' for <Contentful::Link id='ctf-workflows-tag-rWaKGoFkOXCWTIRZPpIbX'>:Contentful::Link (NoMethodError)

Versions

middleman 4.3.11
contentful_middleman: 4.2.0
OS: Ubuntu 20.04

config.rb

activate :contentful do |f|
  f.space         = { site: ENV['CONTENTFUL_SPACE_ID'] }
  f.access_token  = ENV['CONTENTFUL_DELIVERY_TOKEN']
  f.content_types = {pages: "page", navs: "navigation"}
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions