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

Add nise.js as module entry point #10

Closed
griest024 opened this issue Sep 28, 2017 · 6 comments · Fixed by #11
Closed

Add nise.js as module entry point #10

griest024 opened this issue Sep 28, 2017 · 6 comments · Fixed by #11

Comments

@griest024
Copy link
Contributor

import 'nise' throws Uncaught ReferenceError: global is not defined.

griest024 added a commit to griest024/nise that referenced this issue Sep 28, 2017
@fatso83
Copy link
Contributor

fatso83 commented Sep 28, 2017

This description is way too brief. There is nothing showing that this is a problem. Can you point to a description somewhere where this is a problem, or give some reproducible way of establishing that the current way is not working?

@fatso83
Copy link
Contributor

fatso83 commented Sep 28, 2017

I think we can make a reproducible case if looking at this comment from chaijs/sinon-chai#111.

@griest024
Copy link
Contributor Author

Sorry for the short description. Basically, when the entry point is lib/main.js, I get a

Uncaught ReferenceError: global is not defined
  at webpack:///~/nise/lib/fake-xhr/index.js:30:0

Unfortunately I can't exactly say what causes this, since its a dependency that is importing nise, I'm not using it directly.

@fatso83
Copy link
Contributor

fatso83 commented Sep 29, 2017

Ah, so it is a Webpack issue. That was the essential missing bit.

@griest024
Copy link
Contributor Author

Since module isn't actually an npm option, I don't think it could break anything (famous last words) to add it to package.json. It does fix the issue though.

@griest024
Copy link
Contributor Author

@fatso83 after more research, I found that this error is a result of calling sinon.spy()

fatso83 pushed a commit that referenced this issue Oct 3, 2017
fatso83 added a commit to fatso83/sinon that referenced this issue Oct 4, 2017
franck-romano pushed a commit to franck-romano/sinon that referenced this issue Oct 1, 2019
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

Successfully merging a pull request may close this issue.

2 participants