Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON parsing fails in Rails 7.1 apps #207

Open
tdutreui-solocal opened this issue Nov 2, 2023 · 0 comments
Open

JSON parsing fails in Rails 7.1 apps #207

tdutreui-solocal opened this issue Nov 2, 2023 · 0 comments

Comments

@tdutreui-solocal
Copy link

Which SDK version are you using?

18.0.2

What's the issue?

unexpected token at 'from response' (JSON::ParserError)

from /usr/local/lib/ruby/3.2.0/json/common.rb:216:in `parse'
	from /home/effilab/vendor/bundle/ruby/3.2.0/gems/facebookbusiness-18.0.2/lib/facebook_ads/api_response.rb:18:in `result'
	from /home/effilab/vendor/bundle/ruby/3.2.0/gems/facebookbusiness-18.0.2/lib/facebook_ads/ad_object.rb:122:in `block (3 levels) in <class:AdObject>'
	from /home/effilab/vendor/bundle/ruby/3.2.0/gems/facebookbusiness-18.0.2/lib/facebook_ads/api_request.rb:58:in `create_response'
	from /home/effilab/vendor/bundle/ruby/3.2.0/gems/facebookbusiness-18.0.2/lib/facebook_ads/api_request.rb:41:in `execute_now'
	from /home/effilab/vendor/bundle/ruby/3.2.0/gems/facebookbusiness-18.0.2/lib/facebook_ads/api_request.rb:36:in `execute'
	from /home/effilab/vendor/bundle/ruby/3.2.0/gems/facebookbusiness-18.0.2/lib/facebook_ads/ad_object.rb:120:in `block (2 levels) in <class:AdObject>'
	from /home/effilab/vendor/bundle/ruby/3.2.0/gems/facebookbusiness-18.0.2/lib/facebook_ads/edge.rb:52:in `fetch_next_page'
	from /home/effilab/vendor/bundle/ruby/3.2.0/gems/facebookbusiness-18.0.2/lib/facebook_ads/edge.rb:19:in `[]'
	from /home/effilab/vendor/bundle/ruby/3.2.0/gems/facebookbusiness-18.0.2/lib/facebook_ads/edge.rb:33:in `each'
	from /home/effilab/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.1/lib/active_support/core_ext/enumerable.rb:150:in `map'
	from /home/effilab/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.1/lib/active_support/core_ext/enumerable.rb:150:in `pluck'

Steps/Sample code to reproduce the issue

Call the owned_ad_accounts method with any valid parameters

FacebookAds::Business.get(...).owned_ad_accounts(
      search_query: query,
      fields: %i[account_id],
      limit: 10
    ).pluck(:account_id)

this Gemfile works:

gem "actionpack", "7.0.8"
gem "activemodel", "7.0.8"
gem "activerecord","7.0.8"
gem "railties", "7.0.8"

this Gemfile doesn't :

gem "actionpack", "7.1.0" # or above
gem "activemodel", "7.1.0"
gem "activerecord","7.1.0"
gem "railties", "7.1.0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant