6
Sto importando whatwg-fetch
(https://github.com/github/fetch) nella mia appwebpack/Babel/ES6 import edizione - (0, _whatwgFetch2.default) non è una funzione
import fetch from 'whatwg-fetch';
per lo sviluppo locale che uso webpack-dev-server
. Ho ottenuto questo messaggio di errore:
test.js?ba55:67 Uncaught TypeError: (0 , _whatwgFetch.fetch) is not a function
Si è sparato da questa linea:
fetch('/api/mydata', opts)
Perché l'importazione non è riuscita?
A volte, quando rispondo mie domande mi chiedo Beh, solo per quello che sai, pubblicare la tua risposta mi ha aiutato a capire un problema che aveva solo quattro risultati Google (questo uno e tre inutili). Grazie! – machineghost