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

superagent-no-cache use error #21

Open
zhoudaqing opened this issue Mar 31, 2017 · 5 comments
Open

superagent-no-cache use error #21

zhoudaqing opened this issue Mar 31, 2017 · 5 comments

Comments

@zhoudaqing
Copy link

const nocache = require('superagent-no-cache');
const request = require('superagent');

request
.get('/test')
.use(nocache)
.end(function(err, res){
});

error:

/Users/akk/sourcecode/test/node_modules/component-ie/index.js:16
el = document.createElement('b'),
^

ReferenceError: document is not defined
at ie (/Users/akk/sourcecode/test/node_modules/component-ie/index.js:16:26)
at Object. (/Users/akk/sourcecode/test/node_modules/component-ie/index.js:5:18)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/Users/akk/sourcecode/test/node_modules/superagent-no-cache/index.js:1:72)

Process finished with exit code 1

piascikj added a commit to imdone/superagent-no-cache that referenced this issue May 8, 2017
@johntron
Copy link
Owner

This error would be eliminated by using the alternative method described here: #23. @zhoudaqing - does this solve your problem?

@qng5150
Copy link

qng5150 commented Sep 20, 2017

Getting this error as well even after adding the #23

@johntron
Copy link
Owner

@shinta5150 help me reproduce it. If you're still getting this error, you're either not using #23, you haven't rebuilt, or you're trying to do something like use component-ie in nodejs.

@Floriangomis
Copy link

Floriangomis commented Jan 25, 2018

@shinta5150 It might be because as me you are not using it in a browser environnement so you don't have access to document object ?

@mackenzie-orange
Copy link

Because #23 resolves this issue, could superagent-no-cache get an npm release?

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

5 participants