-
Notifications
You must be signed in to change notification settings - Fork 21
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
require is not defined on browser #32
Comments
I just ran into this also. I think it's some kind of compilation problem? |
It shouldn't be disabled. It worked on my computer. I'll look into this right away. |
Just to add, I've just upgraded from 0.15 to 0.16 and the latest corresponding version of elm-test and I'm also seeing this error. Have had a quick look into this but haven't found anything yet. |
OK, I've tracked down the problem. It's due to importing the console runner by default now, which evaluates I can add some runtime checks in |
Looks like it's a matter of waiting for Laszlo to merge, which he should in the next day. I monkey patched my version and can continue testing. Thanks again! |
@deadfoxygrandpa thank you for your quick efforts here, they are much appreciated :) |
@laszlopandy just updated this. If you're still having issues, wipe out your elm-stuff directory and run I'll publish a minor update to elm-test to increase the dependence on elm-console to 1.0.3 so this won't be able to affect people again. |
Thanks Alex and sorry for the delay everyone! |
No problem Laszlo, it was over the weekend and only a couple days. |
3.0.1 is required to fix deadfoxygrandpa/elm-test#32
Thank you guys! 😺 I appreciate it! |
Bumping the dependency is a good idea, but even so elm-package will pull down the latest elm-console within version bounds right? |
Yes, it will, but this way it explicitly disallows a broken combination, and also if someone was affected by this issue and isn't reading this github issue then they can try updating elm-test and it will also pull the new elm-console dependency. |
Hey @deadfoxygrandpa and @laszlopandy I still see this issue when compiling my test code with webpack via the elm-webpack-loader. Seems like the fix in
The elm webpack loader does end up adding I have not tried a fix yet but I am hoping that just checking if require is defined should work. After investigating this issue I was left with this question. Does it make sense for the test runners to be part of this package? It seems like users that want to run their tests in both the browser and in node would need two elm main files anyway why not skip this whole class of problems by removing the need to load node specific code in the browser at all? Either way, Thanks for the great package! |
I did give it a try with an additional check to see if
@laszlopandy I can open an issue and submit a pull request if you would like. |
If you update to 1.1.1 it should fix this issue. It only checks if require is undefined. So if it is defined on the window (by require.js for example) this solution will not work. Please file another issue if that is the case. |
Since 3.0.0, executing test on a browser always causes an error that
Is running on browser disabled from v3.0.0?
The text was updated successfully, but these errors were encountered: