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

FS Dependency issue #143

Closed
sakshigargit opened this issue Sep 11, 2017 · 5 comments
Closed

FS Dependency issue #143

sakshigargit opened this issue Sep 11, 2017 · 5 comments

Comments

@sakshigargit
Copy link

I am using this in vuejs. After installing this library using npm.
And added importing line in my app.js file
Vue.use(require('prerender-node').whitelisted(['/judgements', '/judgements/.*', '/articles', '/articles/.*', '/', '/plans']));

And run the npm using (npm run watch) after that I was getting the below error

ERROR  Failed to compile with 6 errors      

These dependencies were not found:

* fs in ./~/request/lib/har.js
* net in ./~/forever-agent/index.js, ./~/tough-cookie/lib/cookie.js and 1 other
* tls in ./~/forever-agent/index.js, ./~/tunnel-agent/index.js

To install them, you can run: npm install --save fs net tls
                                                                                                   Asset       Size  Chunks                    Chunk Names
                    fonts/vendor/font-awesome/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e    77.2 kB          [emitted]         
 fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.eot?f4769f9bdb7466be65088239c12046d1    20.1 kB          [emitted]         
 fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.ttf?e18bbf611f2a2e43afc071aa2f4e1512    45.4 kB          [emitted]         
fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.woff?fa2772327f55d8198301fdb8bcfc8158    23.4 kB          [emitted]         
fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.woff2?448c34a56d699c29117adc64c43affeb      18 kB          [emitted]         
                      fonts/vendor/font-awesome/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713     166 kB          [emitted]         
                      fonts/vendor/font-awesome/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde     444 kB          [emitted]  [big]  
                      fonts/vendor/font-awesome/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9     166 kB          [emitted]         
                     fonts/vendor/font-awesome/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad      98 kB          [emitted]         
 fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.svg?89889688147bd7575d6327160d64e760     109 kB          [emitted]         
                                                           /compiled/js/frontend.8a361286480f046fd2f7.js    14.6 MB       0  [emitted]  [big]  /compiled/js/frontend
                                                            /compiled/js/backend.8d88b8162913e7c37c34.js    2.62 MB       1  [emitted]  [big]  /compiled/js/backend
                                                                             mix.4e7199e63bbe8d9e2ee9.js    8.93 kB       2  [emitted]         mix
                                         /compiled/css/frontend/app.8aacf05735c5aa820e169a1dc27c1637.css     882 kB       2  [emitted]  [big]  mix
                                           /compiled/css/sweetalert.b843d0134e4eb95999029be3b4928ed2.css    88.8 kB       2  [emitted]         mix
                                              /compiled/css/plugins.247b773c8f740a7ae6a6afdd9eb8284a.css    25.7 kB       2  [emitted]         mix
                                          /compiled/css/backend/app.210f87eb95d9c1cc3e31e2f13739f149.css    1.39 MB       2  [emitted]  [big]  mix
                                                                                       mix-manifest.json  599 bytes          [emitted]         

WARNING in ./~/ajv/lib/async.js
96:20-33 Critical dependency: the request of a dependency is an expression

WARNING in ./~/ajv/lib/async.js
119:15-28 Critical dependency: the request of a dependency is an expression

WARNING in ./~/ajv/lib/compile/index.js
13:21-34 Critical dependency: the request of a dependency is an expression
ERROR  Failed to compile with 6 errors          

These dependencies were not found:

* fs in ./~/request/lib/har.js
* net in ./~/forever-agent/index.js, ./~/tough-cookie/lib/cookie.js and 1 other
* tls in ./~/forever-agent/index.js, ./~/tunnel-agent/index.js

To install them, you can run: npm install --save fs net tls
                                                                                                   Asset       Size  Chunks                    Chunk Names
                    fonts/vendor/font-awesome/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e    77.2 kB          [emitted]         
 fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.eot?f4769f9bdb7466be65088239c12046d1    20.1 kB          [emitted]         
 fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.ttf?e18bbf611f2a2e43afc071aa2f4e1512    45.4 kB          [emitted]         
fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.woff?fa2772327f55d8198301fdb8bcfc8158    23.4 kB          [emitted]         
fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.woff2?448c34a56d699c29117adc64c43affeb      18 kB          [emitted]         
                      fonts/vendor/font-awesome/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713     166 kB          [emitted]         
                      fonts/vendor/font-awesome/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde     444 kB          [emitted]  [big]  
                      fonts/vendor/font-awesome/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9     166 kB          [emitted]         
                     fonts/vendor/font-awesome/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad      98 kB          [emitted]         
 fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.svg?89889688147bd7575d6327160d64e760     109 kB          [emitted]         
                                                           /compiled/js/frontend.8a361286480f046fd2f7.js    14.6 MB       0  [emitted]  [big]  /compiled/js/frontend
                                                            /compiled/js/backend.8d88b8162913e7c37c34.js    2.62 MB       1  [emitted]  [big]  /compiled/js/backend
                                                                             mix.4e7199e63bbe8d9e2ee9.js    8.93 kB       2  [emitted]         mix
                                         /compiled/css/frontend/app.8aacf05735c5aa820e169a1dc27c1637.css     882 kB       2  [emitted]  [big]  mix
                                           /compiled/css/sweetalert.b843d0134e4eb95999029be3b4928ed2.css    88.8 kB       2  [emitted]         mix
                                              /compiled/css/plugins.247b773c8f740a7ae6a6afdd9eb8284a.css    25.7 kB       2  [emitted]         mix
                                          /compiled/css/backend/app.210f87eb95d9c1cc3e31e2f13739f149.css    1.39 MB       2  [emitted]  [big]  mix
                                                                                       mix-manifest.json  599 bytes          [emitted]         

WARNING in ./~/ajv/lib/async.js
96:20-33 Critical dependency: the request of a dependency is an expression

WARNING in ./~/ajv/lib/async.js
119:15-28 Critical dependency: the request of a dependency is an expression

WARNING in ./~/ajv/lib/compile/index.js
13:21-34 Critical dependency: the request of a dependency is an expression

Then I have run this command as per the instructions npm install --save fs net tls

But still I am getting below error.


 ERROR  Failed to compile with 1 errors 

This dependency was not found:

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

To install it, you can run: npm install --save fs
                                                          Asset       Size  Chunks                    Chunk Names
/compiled/css/frontend/app.8aacf05735c5aa820e169a1dc27c1637.css     882 kB       2  [emitted]  [big]  mix
  /compiled/css/sweetalert.b843d0134e4eb95999029be3b4928ed2.css    88.8 kB       2  [emitted]         mix
     /compiled/css/plugins.247b773c8f740a7ae6a6afdd9eb8284a.css    25.7 kB       2  [emitted]         mix
 /compiled/css/backend/app.210f87eb95d9c1cc3e31e2f13739f149.css    1.39 MB       2  [emitted]  [big]  mix
                                              mix-manifest.json  962 bytes          [emitted]         

WARNING in ./~/ajv/lib/compile/index.js
13:21-34 Critical dependency: the request of a dependency is an expression

WARNING in ./~/ajv/lib/async.js
96:20-33 Critical dependency: the request of a dependency is an expression

WARNING in ./~/ajv/lib/async.js
119:15-28 Critical dependency: the request of a dependency is an expression

From somewhere I have read to add the empty dependency of all the required modules in webpack.config.js

exports.node = {
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty',
};

But after doing this I am getting the below warnings

WARNING  Compiled with 3 warnings                                                                                                                                    

warning  in ./~/ajv/lib/async.js

96:20-33 Critical dependency: the request of a dependency is an expression

warning  in ./~/ajv/lib/async.js

119:15-28 Critical dependency: the request of a dependency is an expression

warning  in ./~/ajv/lib/compile/index.js

13:21-34 Critical dependency: the request of a dependency is an expression

I am not sure where I am doing wrong. Please help me out in this.

@thoop
Copy link
Contributor

thoop commented Sep 11, 2017

I don't see anything about prerender-node in those errors. I don't think any of those errors have anything to do with prerender-node since those aren't dependencies of prerender-node.

Feel free to reopen if I'm wrong.

@thoop thoop closed this as completed Sep 11, 2017
@sakshigargit
Copy link
Author

sakshigargit commented Sep 12, 2017

@thoop I am facing this issue after adding the below line in my code. So, it seems like either I am going something wrong or the issue is Vue.
Vue.use(require('prerender-node').whitelisted(['/judgements', '/judgements/.*', '/articles', '/articles/.*', '/', '/plans']));

Please look on it and help me out
Thanks in advance!!

@thoop
Copy link
Contributor

thoop commented Sep 13, 2017

Did you run npm install prerender-node --save? That's all you need to do. Does Vue.use support Connect compatible middleware?

@thoop thoop reopened this Sep 13, 2017
@thoop thoop mentioned this issue Sep 13, 2017
@sakshigargit
Copy link
Author

Actually, I need to check out what is it and whether the Vue supports it or not. Yes, I have run the above command only and add it to my project.

@thoop
Copy link
Contributor

thoop commented Mar 1, 2018

Were you able to fix this and did it have anything to do with prerender-node? Feel free to reopen if needed.

@thoop thoop closed this as completed Mar 1, 2018
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

2 participants