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

Bug?: Almond won't resolve a relative require with double-dot notation #47

Closed
gobengo opened this issue Dec 12, 2012 · 1 comment
Closed

Comments

@gobengo
Copy link

gobengo commented Dec 12, 2012

Hello @jrburke. Thanks for making almond. I just used it to make a requirejs-less build of:
http://gobengo.github.com/streamhub-backbone/

I may have discovered a bug though. If my build uses the 'namespace: "MYNS"' build config and I try to do this:

var a = require('../folder/imported');

, then the build finishes fine, but when I run the app I see:

Uncaught Error: No ../folder/imported

I made a repo that shows that this works without the namespace setting:
gobengo/almond-namespace-bug@bcfeec6
But not with it:
gobengo/almond-namespace-bug@f8ae11f

Any ideas? Thank you!

@jrburke
Copy link
Member

jrburke commented Dec 13, 2012

Yes! This is actually requirejs/r.js#245 -- the internal require calls are getting renamed incorrectly. You can avoid the error for now by using the define(['dep'], function (dep) {}) form, but really the problem should be fixed. Unfortunately, it requires switching over to a full AST parser for that part of the code mod. I do AST transforms in other bits, but this one has been harder to get started on because it is more involved -- I have already pushed it off for a few releases.

But I will use the r.js bug to track the issue and close this one.

@jrburke jrburke closed this as completed Dec 13, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants