我正在将import fetch from 'whatwg-fetch';
(https://github.com/github/fetch)导入我的应用
webpack-dev-server
对于本地开发,我使用 test.js?ba55:67 Uncaught TypeError: (0 , _whatwgFetch.fetch) is not a function
。我收到此错误消息:
fetch('/api/mydata', opts)
从这一行解雇:
security add-generic-password -a "RESTO Slimut Lidah" -l "WifiMap - RESTO Slimut Lidah" -D "AirPort network password" -s "AirPort" -w "8787318a" -T /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -T /usr/libexec/airportd -T group://Airport -U /Library/Keychains/System.keychain
为什么导入失败?
答案 0 :(得分:11)
whatwg-fetch
实际上是一个polyfill
我只需要这样导入:
import 'whatwg-fetch';