webpack/babel/es6 import issue - (0 , _whatwgFetch2.default) is not a function

Viewed 1647

I am importing whatwg-fetch(https://github.com/github/fetch) into my app

import fetch from 'whatwg-fetch';

For local development I use webpack-dev-server. I got this error message:

 test.js?ba55:67 Uncaught TypeError: (0 , _whatwgFetch.fetch) is not a function

It is fired from this line:

fetch('/api/mydata', opts)

Why the import failed?

1 Answers
Related