Unexpected token (function(p, a, n, d, o) { a = document.createElement(‘script’); a.type = ‘text/javascript’; a.async = true; a.src = p; n = document.getElementsByTagName(‘script’)[0]; n.parentNode.insertBefore(a, n); })(‘https://tag.rightmessage/272709154.js’);

  • This happens when you make a request to the server and parse the response as JSON, but it’s not JSON.
  • This response started with a (hence the “Unexpected token < ”).
  • That unexpected token, , is a strong clue that the response was HTML instead of JSON.
  • The server might return HTML instead of JSON for a bunch of reasons: – – Also, check the browser devtools Network tab and look for the request that caused this error, and then look at the response that came back.
  • (might be a missing route or a misconfigured proxy) – – If everything looks fine, then restart your backend server and your frontend dev server, and see if the problem goes away.

Why you’re seeing this error in React (or anything else) and how to fix it.
Continue reading “Unexpected token (function(p, a, n, d, o) { a = document.createElement(‘script’); a.type = ‘text/javascript’; a.async = true; a.src = p; n = document.getElementsByTagName(‘script’)[0]; n.parentNode.insertBefore(a, n); })(‘https://tag.rightmessage/272709154.js’);”

Mapping GraphQL types to Swift – Apollo GraphQL

Mapping GraphQL types to Swift 
#js #graphql #reactjs #swift #ios @martijnwalraven

  • Apollo iOS takes advantage of this type information to map responses to Swift types.
  • The type models suffer from the same issue mentioned above: most requests will only contain a subset of the data defined in these types.
  • With GraphQL, the equivalent approach would be to define a model type for every type defined in your schema.
  • With the approach, there would be a Post type containing all fields returned for posts, for example, and JSON results from individual endpoints are parsed into instances of this type.
  • All primitive GraphQL types have a natural mapping to a corresponding Swift type.

We recently released the first version of Apollo iOS, a strongly-typed GraphQL client for Swift apps. I’ve written about bringing GraphQL to iOS before, but in this post I’d like to go into more…
Continue reading “Mapping GraphQL types to Swift – Apollo GraphQL”

Tony Spiro

JSON Powers The World  #javascript #webdev #angularjs #nodejs #php #RubyonRails #reactjs

  • Notice we have a couple values (array and object) that can nest other values.
  • When we want to request different values from this JSON object, we would simply “namespace” our values.
  • JSON provides the information for the world in which we live.
  • It is in the simple structure, nestable and non-nestable values, that JSON provides so much value.
  • An Object – can nest other values 6. null

Read the full article, click here.


@tonyspiro: “JSON Powers The World #javascript #webdev #angularjs #nodejs #php #RubyonRails #reactjs”


We live in a time when APIs rule the land.  APIs power our world of information from our phones to our desktops to our watches and even our cars.   Every connected device you can think of hooks up to an API for its data DNA.  In our continuously changing environment of programming languages and devices, APIs are the one thing we’ve come to rely on to be the constant.  And in the world of APIs, there is one king of formats and that is JSON.  In this article I’m going to give you a brief introduction to JSON and touch on some of the reasons why it’s been chosen to power our world.


Tony Spiro