Comments (10)
@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.
Having the same issue, did you ever figure out a solution?
from fetch-jsonp.
What's the request response?
from fetch-jsonp.
me too!
from fetch-jsonp.
@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.
@fengyun2 can you add a test page to reproduce the error?
from fetch-jsonp.
@ZMil which version are you using?
from fetch-jsonp.
from fetch-jsonp.
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.
Yes thank you! I ended up resolving it but forgot to return to this issue.
from fetch-jsonp.
Related Issues (20)
- Optional callback on URL HOT 1
- CORS FETCH on IE9 HOT 1
- error in ie8 HOT 2
- Does it support react native?How to use jsonp in react native? HOT 1
- Uncaught ReferenceError: jsonCallback is not defined HOT 2
- could you support the interface return a variable HOT 1
- Place callback parameter first inline HOT 1
- Trying to use fetch-jsonp to fech TEXT only value HOT 1
- CDNJS link wrong
- [BUG] There is no jsonCallbackFunction HOT 1
- add support for abort signal??? HOT 2
- Library does not support nonce HOT 1
- Call the local interface in react to report timed out HOT 2
- Multiple requests - being silently aborted and throwing timeouts etc?
- how to import? HOT 1
- How can i change MIME type? HOT 1
- fetch-jsonp HOT 1
- Required options
- Provide an esm version HOT 1
- Provide a fetchPriority option
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fetch-jsonp.