-
Notifications
You must be signed in to change notification settings - Fork 56
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
Fibers compilation thru require() hook causes repeated errors #187
Comments
Looped, and yes, it finally does run by the end. But then we're back to the same runtime errors we see when we explicitly pre-compile and run with staple |
It is because the signature of the I can fix it by renaming |
Ah, thanks for catching that! No need to change anything on your end. I'll update coffee-streamline. Btw, coffee-streamline was a quick hack, always meant as a temporary solution to the problem of slow compilation times. You added caching to the Streamline compilation part, but it still doesn't cache the CoffeeScript compilation in the case of |
Why do you want to cache the intermediate CS file? If the I still think that I should fix |
Ah, I wasn't clear. What I meant was: Streamline's https://github.com/Sage/streamlinejs/blob/master/lib/compiler/underscored.js#L123-L142 coffee-streamline, on the other hand, skips both compilers if the source file hasn't changed. https://github.com/aseemk/coffee-streamline/blob/master/coffee-streamline.js#L199-L211 Good call on fixing the API either way. Should I hold off on making any changes to coffee-streamline then? |
Further clarification: Streamline's |
OK. I get it now. This should be fixed in the streamline layer. I'm going to fix the transform call but not tonite. So you may need a temporary fix. |
Awesome, thanks Bruno. I wouldn't like to continue using coffee-streamline — I see it as a hack — so if Streamline avoided CS re-compilation, and assuming a quick comparison then made Streamline just as fast as coffee-streamline, I would indeed no longer need coffee-streamline. =) |
@aseemk I enabled the caching improvement to avoid the coffeescript compilation pass when the result is already cached. After more thought (and a dose of laziness) I'm not going to touch the |
Sounds good. I'll update coffee-streamline. Thanks Bruno! |
I haven't figured out how to make a simple repro for this, but figured I'd open this issue with the info I have so far.
We've always compiled and run our app in callbacks mode. I've recently started experimenting with fibers mode for improved debuggability. Initially, it didn't compile, but it failed with the same file each time, so I was able to debug it and find the root cause (issue #185).
Now, with Streamline 0.10.3, all of our files compile perfectly fine when compiled explicitly, via
_coffee --fibers --compile <...>
. (The resulting code doesn't run error-free yet, but we'll get there later.) However, if I try to run it via arequire()
hook —require('streamline').register({fibers: true})
— then it doesn't compile yet.But the crazy thing is, the file it fails on is different every time. If our entry point is file A, and it requires file B, and that requires file C, and so on, the first time the error message is for file A, then if I try again it's for file B, and so on. We have probably over a hundred files, so I haven't finished retrying 100+ times to see if works by the end yet. I'll write a loop to do that soon.
The error message is always the same,
TypeError: Object <the whole compiled file> has no method 'replace'
. E.g.:Any idea what might be happening?
The text was updated successfully, but these errors were encountered: