kadirahq / lokka-transport-http

HTTP Transport Layer for Lokka
MIT License
41 stars 38 forks source link

Version 1.4 does not work with webpack #7

Open misogl opened 8 years ago

misogl commented 8 years ago

In version 1.4 you have removed the use of isomorphic-fetch. This however causes problem in webpack, as it now tries to build the app with both whatwg-fetch and node-fetch, which fails.

A possible workaround for this issue would be to configure webpack so it uses something like a null-loader for node-fetch, but I consider this more like a hack than a real solution.

callmephilip commented 8 years ago

Seeing the same issue when using with React Native's packager

leebenson commented 8 years ago

I'm playing catch-up here, but what was the point of removing isomorphic-fetch? I'm getting this same issue with a standard isomorphic webpack build

pukapukan commented 8 years ago

Any update on this?

antitoxic commented 8 years ago

Same here. Is the project dying out? @arunoda

unfernandito commented 7 years ago

The solution is comment these lines on node_modules/lokka-transport-http/dist/index.js

if (typeof fetch === 'function') { // has a native fetch implementation fetchUrl = fetch; } /else if (isNode()) { // for Node.js fetchUrl = require('node-fetch'); fetchUrl.Promise = _promise2.default; } else { // for the browser require('whatwg-fetch'); fetchUrl = fetch; }/