Comments (8)
This library is intended to be a thin wrapper around the browser fetch-polyfil first, and isomorphic second. That being said, I'd like to see a reduction to see this behaviour in action. Could you show me how to reproduce this please?
from fetch-ponyfill.
I've made a gist:
https://gist.github.com/mienaikoe/adc59f9e72e98c287498318a96998f33
from fetch-ponyfill.
my npm dependency list for this is:
"dependencies": {
"es6-promise": "^3.2.1",
"fetch-ponyfill": "^1.0.0"
}
from fetch-ponyfill.
Are this library's current tests reproducing the problem with the affected version of node-fetch?
from fetch-ponyfill.
Tests run fine as they are. In the tests, I tried replacing 'promise' with 'es6-promise', and I got the same error. I believe this is because 'es6-promise' does not replace the global Promise with itself unless you ask it to do so. 'promise' probably does.
In node-fetch, you can see where it sets Fetch.Promise to be whatever global.Promise is. If global promise doesn't exist, then this will remain as undefined.
The problem arises in the setting of "fetch.Promise", which does nothing. if you want to make a difference to node-fetch, you should be using "Fetch.Promise"
from fetch-ponyfill.
Ah, the problem is in your require
. It looks like you need to change
Promise: require('es6-promise')
to
Promise: require('es6-promise').Promise
from fetch-ponyfill.
@mienaikoe did @paulmelnikow's suggestion help?
from fetch-ponyfill.
Yea. Realized that requiring es6-promise just puts it into the global scope. Paul's suggestion actually assigns it. Closing.
from fetch-ponyfill.
Related Issues (20)
- Version 10 of node.js has been released
- Stops working in Electron as of v5.0.0 HOT 8
- An in-range update of webpack is breaking the build 🚨 HOT 1
- Suggest adding `types` property to package.json HOT 5
- An in-range update of promise is breaking the build 🚨 HOT 1
- ask for release a new version HOT 2
- An in-range update of webpack is breaking the build 🚨 HOT 1
- Abort support HOT 1
- Can't install library HOT 1
- An in-range update of webpack is breaking the build 🚨 HOT 1
- Update dependency minimist > v1.2.3 HOT 1
- Imported multiple times causes multiple fetch instances HOT 3
- webpack issue HOT 2
- IE11 preProcessedHeaders.split(/\r?\n/) HOT 1
- Access to `RequestInit` type HOT 1
- How to intercept the response with fetch-ponyfill?
- Transitive dependency on deprecated `punycode` Node module HOT 2
- An in-range update of sinon is breaking the build 🚨 HOT 4
- An in-range update of sinon is breaking the build 🚨 HOT 1
- An in-range update of webpack-cli is breaking the build 🚨 HOT 1
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-ponyfill.