Giter Site home page Giter Site logo

Comments (10)

camsong avatar camsong commented on August 11, 2024 3

@marineb Finally I can reproduce your error. It's because your are calling a JSON api, which does not support JSONP. The difference is that JSON api respond with an object like {"data": 123}, will got above error when being executed as function. While JSONP will respond with a function wrapped object like jsonp_123132({data: 123}).

from fetch-jsonp.

ZMil avatar ZMil commented on August 11, 2024 1

Having the same issue, did you ever figure out a solution?

from fetch-jsonp.

camsong avatar camsong commented on August 11, 2024 1

What's the request response?

from fetch-jsonp.

fengyun2 avatar fengyun2 commented on August 11, 2024 1

me too!

from fetch-jsonp.

ZMil avatar ZMil commented on August 11, 2024 1

@camsong the response is the error SyntaxError: Unexpected token ':'. Parse error. which is then followed by a timeout error.

To give a little background, I've tried using axios, super agent, and fetch to retrieve data from google maps directions. For each one, I receive the error along the lines of XMLHttpRequest cannot load (api endpoint) Origin http://localhost:3000 is not allowed by Access-Control-Allow-Origin.

I've been able to get around this during development by disabling some chrome security features, but read jsonp might be able to solve this problem for me.

from fetch-jsonp.

camsong avatar camsong commented on August 11, 2024

@fengyun2 can you add a test page to reproduce the error?

from fetch-jsonp.

camsong avatar camsong commented on August 11, 2024

@ZMil which version are you using?

from fetch-jsonp.

ZMil avatar ZMil commented on August 11, 2024

@camsong [email protected]

from fetch-jsonp.

karismatic-megafauna avatar karismatic-megafauna commented on August 11, 2024

Also having this issue!

yarn.lock says =>

fetch-jsonp@^1.1.1:
  version "1.1.1"
  resolved "https://registry.yarnpkg.com/fetch-jsonp/-/fetch-jsonp-1.1.1.tgz#b7b9fd7d3a4f74d38389f5ea2f2d0f46c34510e4"

from fetch-jsonp.

marineb avatar marineb commented on August 11, 2024

Yes thank you! I ended up resolving it but forgot to return to this issue.

from fetch-jsonp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.