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

whitespace after "require" changes behavior #265

Closed
shovemedia opened this Issue May 11, 2012 · 5 comments

Comments

Projects
None yet
2 participants
@shovemedia

shovemedia commented May 11, 2012

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.

@jrburke

This comment has been minimized.

Show comment
Hide comment
@jrburke

jrburke May 11, 2012

Member

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.

Member

jrburke commented May 11, 2012

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.

@shovemedia

This comment has been minimized.

Show comment
Hide comment
@shovemedia

shovemedia May 11, 2012

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:

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.


Reply to this email directly or view it on GitHub:
#265 (comment)

shovemedia commented May 11, 2012

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:

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.


Reply to this email directly or view it on GitHub:
#265 (comment)

@jrburke jrburke closed this in e8fc01a May 11, 2012

@jrburke

This comment has been minimized.

Show comment
Hide comment
@jrburke

jrburke May 11, 2012

Member

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.

Member

jrburke commented May 11, 2012

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.

@shovemedia

This comment has been minimized.

Show comment
Hide comment
@shovemedia

shovemedia May 11, 2012

I'm not sure I follow the "build" workflow you mention. Can you point me to a resource that explains?

and thanks!
:j

On May 11, 2012, at 2:15 PM, James Burke 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.


Reply to this email directly or view it on GitHub:
#265 (comment)

shovemedia commented May 11, 2012

I'm not sure I follow the "build" workflow you mention. Can you point me to a resource that explains?

and thanks!
:j

On May 11, 2012, at 2:15 PM, James Burke 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.


Reply to this email directly or view it on GitHub:
#265 (comment)

@jrburke

This comment has been minimized.

Show comment
Hide comment
@jrburke

jrburke May 11, 2012

Member

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:

http://requirejs.org/docs/optimization.html

Member

jrburke commented May 11, 2012

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:

http://requirejs.org/docs/optimization.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment