Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use #3

Open
deepakkj opened this issue Feb 18, 2018 · 3 comments
Open

Unable to use #3

deepakkj opened this issue Feb 18, 2018 · 3 comments

Comments

@deepakkj
Copy link

I'm getting the following error, when trying to use it.
Not sure where I am going wrong.

I am using webpack 3 with webpack-dev-sever

`ERROR in ./node_modules/rss-to-json/node_modules/request/lib/har.js
Module not found: Error: Can't resolve 'fs' in 'D:\Projects\React Redux News Feed App\node_modules\rss-to-json\node_modules\request\lib'
@ ./node_modules/rss-to-json/node_modules/request/lib/har.js 3:9-22
@ ./node_modules/rss-to-json/node_modules/request/request.js
@ ./node_modules/rss-to-json/node_modules/request/index.js
@ ./node_modules/rss-to-json/src/rss.js
@ ./node_modules/rss-to-json/index.js
@ ./src/actions/channelActions.js
@ ./src/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 ./src/app.js

ERROR in ./node_modules/forever-agent/index.js
Module not found: Error: Can't resolve 'net' in 'D:\Projects\React Redux News Feed App\node_modules\forever-agent'
@ ./node_modules/forever-agent/index.js 6:10-24
@ ./node_modules/rss-to-json/node_modules/request/request.js
@ ./node_modules/rss-to-json/node_modules/request/index.js
@ ./node_modules/rss-to-json/src/rss.js
@ ./node_modules/rss-to-json/index.js
@ ./src/actions/channelActions.js
@ ./src/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 ./src/app.js

ERROR in ./node_modules/tough-cookie/lib/cookie.js
Module not found: Error: Can't resolve 'net' in 'D:\Projects\React Redux News Feed App\node_modules\tough-cookie\lib'
@ ./node_modules/tough-cookie/lib/cookie.js 32:10-24
@ ./node_modules/rss-to-json/node_modules/request/lib/cookies.js
@ ./node_modules/rss-to-json/node_modules/request/index.js
@ ./node_modules/rss-to-json/src/rss.js
@ ./node_modules/rss-to-json/index.js
@ ./src/actions/channelActions.js
@ ./src/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 ./src/app.js

ERROR in ./node_modules/tunnel-agent/index.js
Module not found: Error: Can't resolve 'net' in 'D:\Projects\React Redux News Feed App\node_modules\tunnel-agent'
@ ./node_modules/tunnel-agent/index.js 3:10-24
@ ./node_modules/rss-to-json/node_modules/request/lib/tunnel.js
@ ./node_modules/rss-to-json/node_modules/request/request.js
@ ./node_modules/rss-to-json/node_modules/request/index.js
@ ./node_modules/rss-to-json/src/rss.js
@ ./node_modules/rss-to-json/index.js
@ ./src/actions/channelActions.js
@ ./src/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 ./src/app.js

ERROR in ./node_modules/forever-agent/index.js
Module not found: Error: Can't resolve 'tls' in 'D:\Projects\React Redux News Feed App\node_modules\forever-agent'
@ ./node_modules/forever-agent/index.js 7:10-24
@ ./node_modules/rss-to-json/node_modules/request/request.js
@ ./node_modules/rss-to-json/node_modules/request/index.js
@ ./node_modules/rss-to-json/src/rss.js
@ ./node_modules/rss-to-json/index.js
@ ./src/actions/channelActions.js
@ ./src/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 ./src/app.js

ERROR in ./node_modules/tunnel-agent/index.js
Module not found: Error: Can't resolve 'tls' in 'D:\Projects\React Redux News Feed App\node_modules\tunnel-agent'
@ ./node_modules/tunnel-agent/index.js 4:10-24
@ ./node_modules/rss-to-json/node_modules/request/lib/tunnel.js
@ ./node_modules/rss-to-json/node_modules/request/request.js
@ ./node_modules/rss-to-json/node_modules/request/index.js
@ ./node_modules/rss-to-json/src/rss.js
@ ./node_modules/rss-to-json/index.js
@ ./src/actions/channelActions.js
@ ./src/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 ./src/app.js
webpack: Failed to compile.
error
`

@Kaisaurus
Copy link

Kaisaurus commented Mar 2, 2018

Getting similar error trying to use it with gatsbyjs

 ERROR  Failed to compile with 1 errors                                    12:59:43

This dependency was not found:

* fs in ./~/request/lib/har.js

To install it, you can run: npm install --save fs

reinstalling fs didn't solve the problem :(

@timothyjellison
Copy link

@deepakkj @Kaisaurus This is a longstanding issue with webpack, not an issue with rss-to-json. rss-to-json has a dependency on request which has a dependency on fs, and webpack requires you to add some config to make sure fs doesn't blow everything up. Specifically, add this object to the root level of your webpack config:

node: {
  fs: 'empty'
}

Here's a more fleshed out example that might be helpful: request/request#1529 (comment)

@trickydisco78
Copy link

Did you resolve this @Kaisaurus I'm also running into issues using gatsby. Doesn't look like you can aedit the webpack file in gatsby

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants