-
Notifications
You must be signed in to change notification settings - Fork 69
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
XMLHttpRequest require to use node target in webpack #4
Comments
Hmm. I'm not sure why this is happening. Travis CI seems to handle it fine. Are you sure using the linked library would fix this? What node version are you using? |
I created a sample repo. https://github.com/kresli/stocks-js-test. You can test it with |
Yep. Managed to reproduce it. I'm not really familiar with what |
I'm quite embarassed to say I never knew It seems to work like a charm (run from page with appropiate content security policy): fetch('https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=MSFT&interval=1min&apikey=demo')
.then(function (response) {
return response.json()
}).then(function (body) {
console.log(body)
}); |
I made a version with |
Follow this approach, it will solve the problem: |
I need to add
target: 'node'
to my webpack config otherwise I've got this errorI would suggest to use https://www.npmjs.com/package/whatwg-fetch. I can create a pull request
The text was updated successfully, but these errors were encountered: