Socket.io: This dependency was not found: * fs in ./node_modules/socket.io/lib/index.js

Created on 14 Nov 2017  路  6Comments  路  Source: socketio/socket.io

Note: for support questions, please use one of these channels: stackoverflow or slack

You want to:

  • [x] report a bug
  • [ ] request a feature

Current behaviour

Steps to reproduce (if the current behaviour is a bug)

Note: the best way to get a quick answer is to provide a failing test case, by forking the following fiddle for example.

Expected behaviour

Setup

  • OS:
  • browser:
  • socket.io version:

Other information (e.g. stacktraces, related issues, suggestions how to fix)

Most helpful comment

Are you using webpack?

In your Webpack Config, add: node: { fs: 'empty' }.

All 6 comments

This is the same issue when I require('socket.io').

npm fs is a security holder package: https://www.npmjs.com/package/fs

Recommend socket.io move to file-system or another library instead.

Are you using webpack?

In your Webpack Config, add: node: { fs: 'empty' }.

Hi! Is there something we can fix? Could you provide more context please?

@darrachequesne anything you can do to make it so when running webpack, we don't need node: { fs: 'empty' } ?

@Dwood15 it seems { fs: 'empty' } was not needed in our webpack example, could you please check?

Was this page helpful?
0 / 5 - 0 ratings