-
-
Notifications
You must be signed in to change notification settings - Fork 473
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
ReferenceError: self is not defined ( Mocha+JSdom ) #177
Comments
Hi! Do you mind providing a bare bone repro of your issue? |
This patch broke our testing build. After looking into the problem we were able to fix it by defining a global self variable in our jsdom setup like this:
|
This issue was caused by 9dc45a6. The problem here is that |
Same issue breaks attempts to use |
|
@ekulabuhov Since the only barrier for use of Updating this line of code with something like may solve the problem and still be able to detect IE 6-9. Test itself is taken from Browserhacks. |
@FlyingDR There's no problem with fixing this line. The problem is that there's no guarantee that the next feature/bug-fix will not break it again. Best advice here is to make your environment match the Browser API as much as possible. |
It is good point, but since there is real use cases when current code breaks builds - I think it is good idea to either update it to be more safe or at least to add some runtime error in development environment or maybe FAQ question so people that will not need to spend much time trying to find out why their build get broken by simple CSS attachment. |
I agree. And it should throw a runtime error as implemented here: 0d5089b. But it seems like some test environments are able to bypass that check. Meaning that they simulate some parts of the browser API while leaving out others. |
@FlyingDR Mind sending a PR with eventual fixes and to better discuss the issue? 😛 |
@michael-ciniawsky I'm not quite sure if PR with solution proposed by me above will be acceptable, taking in mind obviously correct comments from @ekulabuhov Personally I still think that it is quite safe to check for property existence before accessing them to make assumption about environment, code is running in, but this point may not be accepted by this project, I'm not part of. I can, of course, prepare PR based on my version of the fix. |
@FlyingDR Well I'm not sure about it 🙃 , seems it happend here 9dc45a6 if you not pissed of enterily if the PR gets rejected, send one please for futher discussion, otherwise I fully understand if you're not interested at all 😛
|
@michael-ciniawsky I've added pull request #196 |
Released and published as https://github.com/webpack-contrib/style-loader/blob/v0.16.0/CHANGELOG.md#change-log |
Version
0.13.2
Request
Bug
Current behavior
Got the following error when running test cases with mocha+jsdom. Same test run fine with version 0.13.1
The text was updated successfully, but these errors were encountered: