node-twitter icon indicating copy to clipboard operation
node-twitter copied to clipboard

packaging with webpack

Open evereveron opened this issue 7 years ago • 7 comments

I'm getting errors when packaging with webpack. It can't resolve modules such as 'fs' which makes me wonder if anyone has used webpack in combination with this library. I am on the most up to date version (1.7.0)

evereveron avatar May 16 '17 19:05 evereveron

fs is a server side library in node core. Its not typically used in client side apps.

I think there is a way to fake it out though. why is node-twitter using fs though?

anthonyettinger avatar May 16 '17 22:05 anthonyettinger

@anthonyettinger Yeah true... I tried it on my server side code instead and it runs perfectly fine. Guess it's not really a webpack issue

evereveron avatar May 17 '17 14:05 evereveron

The same here.

soulclown avatar Jun 29 '17 09:06 soulclown

Have we resolved anything here:

I'm trying to run this with React and I'm getting the fs issue?

jamesfriedal avatar Sep 21 '17 21:09 jamesfriedal

^^^^

layonthebeech avatar Dec 30 '17 20:12 layonthebeech

Hey guys, you might want to try this. Add the following code in webpack.config.js. Found this somewhere else, it seems to be a known issue in webpack.

node: {
    console: false,
    fs: 'empty',
    net: 'empty',
    tls: 'empty'
  }

cogitoergosumsw avatar Jan 18 '18 07:01 cogitoergosumsw

@heyhujiao unfortunately I've tried your solution and it didn't work out. I'm using webpack also along with react 16.2

does anyone figured it out ?

2bezzat avatar Jul 02 '18 20:07 2bezzat