-
Notifications
You must be signed in to change notification settings - Fork 2.4k
whitespace after "require" changes behavior #265
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
Comments
Right now I'm getting a 404 for that zip file, just let me know when it is working, and I'll give it a try. |
http://shovemedia.com/requirejsIssue.zip Silly capitalization. Knew I should have double-checked my link :j On May 11, 2012, at 1:23 PM, James Burke reply@reply.github.com wrote:
|
Ouch, yeah, just a regexp problem. Looks like there was a recent change in the behavior of Function.prototype.toString() in at least Chrome, probably all latest WebKit browsers. For what it is worth, this is only an issue in source form, after a build it, the optimizer would have found it correctly. But the source form is super important to have working, and the regexp should have allowed for this anyway. It is fixed now in the dev2.0 branch, and I updated the errors page to mention this problem in 1.0.x, may do a backport if a 1.0.9 release gets scheduled. |
I'm not sure I follow the "build" workflow you mention. Can you point me to a resource that explains? and thanks! On May 11, 2012, at 2:15 PM, James Burke wrote:
|
I meant the requirejs optimizer, r.js, would have found the dependency, but normally that is just used for when doing a build to combine your resources together, not helpful for dev/source loading: |
A very simple test case at http://shovemedia.com/requirejsissue.zip
See /js/Main.js for two lines you can swap back and forth.
The only difference is the whitespace.
If you bring up index.html in Chrome with the javascript console, you'll
see an alert when the extra space is removed (correct behavior),
and the following error when it's present:
Uncaught Error: Module name 'SomeModule' has not been loaded yet for context:
Tested with the latest version before sending, both commented and minified.
The text was updated successfully, but these errors were encountered: