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

Require.js support broken #61

Open
mlippens opened this issue Oct 10, 2013 · 2 comments
Open

Require.js support broken #61

mlippens opened this issue Oct 10, 2013 · 2 comments

Comments

@mlippens
Copy link

I know that the feature was marked as experimental but anyways. I tried the example supplied, which didn't seem to be working, so I ended up digging in to see what's going on. I tore apart the code that is wrapped around each file that is compiled with the contracts flag. I set up a similar small example to test.

  • An uncaught error happens!
    fyi: I checked by compiling without contracts that the error is not my module definition.
Uncaught TypeError: undefined is not a function 

If wanted I can create a gist with the code to illustrate the error. If you have any pointers I can look on how to fix it myself.

Here is the relevant part of the code injected by the contracts.coffee compiler: https://gist.github.com/froginvasion/6925391 I annotated it, but this piece of code doesn't particularely make much sense to me. I put it next to the implementation of define in require.js but more than a general sense of what's actually happening I don't have.

Maybe a solution is reverting to an older version of require.js? This is what i'll try next.

@disnet
Copy link
Owner

disnet commented Oct 29, 2013

Sorry about the delayed response. Did reverting to an older version of require.js work for you? If not could you post the entire compiled script that is failing for you? I'm guessing that the __contracts function is not getting bound correctly.

@mlippens
Copy link
Author

For me, using either chrome-stable with flags enabled or Firefox 25 the initial test failes in contracts.coffee/test/webtest/modules.html. You are correct in your assumption. Firebug reports TypeError __contracts is null. Any input on how to fix this? I debugged the code that contracts.coffee generates to support Require.js but couldn't exactly figure out what the problem is. Thanks for your response! (And sorry for my own late response)

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

2 participants