-
Notifications
You must be signed in to change notification settings - Fork 128
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
Object.defineProperty called on non-object #51
Comments
Could you find out what traceur is trying to do? Especially this line:
Currently I can't see that rewire has something to do with it. |
All it is doing is checking for a shim and then calling the object's normal
I'm not sure why this would be a problem in Treaeur, because everything works fine as long as I don't use rewire. Is there anything else I can do to try to help troubleshoot? |
You could create a minimal test-case that produces the error. And you could also check what value |
Alright, I'll try to put something together in the next few days. |
OK, it seems that this occurs if the module being rewired exports a string or a variable with a string value. Is that not a supported use of rewire? |
Uses npm-which to try to resolve a binary for ember first in local node_modules, and then in parent node_modules and the user's path, the same way that a native npm `require()` works. More tests would be good to have, intent is to use rewire to inject process.platform and process.cmd, but for now rewire does not work for modules which return a simple string or variable with a string value. See jhnns/rewire#51
@IanVS are you using mocha as test runner? |
Sorry, I've over-read this. Unfortunately yes, rewiring modules that export a primitive value is not possible, because the current API needs to attach methods like |
Hopefully this isn't just user error, since I'm new to rewire.
I am getting the following error when I change a
require
to arewire
:Where it seems to be failing in the module I'm requiring is here (ember.js:29:8):
Any thoughts on what could be going wrong here? I can provide more info if you let me know what would be helpful. Thanks!
The text was updated successfully, but these errors were encountered: