-
-
Notifications
You must be signed in to change notification settings - Fork 364
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
set bufferLoaded to true for loaded buffers #56
Conversation
set bufferLoaded to true for loaded buffers, fixes issue when setBuffer is called before load.
I've included a fix for this in the master branch - please let me know how this works for you. I'm including the associated changes in require-less now. |
This fixed issue #58 |
Your fix doesn't work for me unfortunately. cssAPI.load is still called after cssAPI.setBuffer for some resources. |
Thanks for reporting - helps a lot. Can you provide more details on the environment or a test case? cssAPI.load is the plugin hook called by requirejs. There is some quite careful buffer checking to stop duplicate loads and it could be going wrong at various stages of interrupt in the load cycle, so I need to be able to figure out where this is. |
Is this using less, css or both? They are two separate buffers so it could be an issue having them run together. |
We use both, but it seems to fail only for less stylesheets (though I have not done any extensive testing whether I can make it fail for css too). I'll try to create a test case. |
A test case would be useful - I'm unable to replicate this using a basic combination of css and less, so knowing how you are including which scripts when would help in finding the issue. |
Alright, it took some time to get a simple test case, but I think I have found one. When a css/less resource is specified as an include in the build file, and then retrieved using an async require, this issue occurs. |
My test case is pretty much that but perhaps the issue here is that in my test case I am running locally with no network delay. Any chance of sharing a repo on github or archive? There was also a buffer fix as referenced above which has been committed. Let me know if that helps at all as well. |
I'm closing this assuming the previous fix sorted this out. If not, let me know if you are still experiencing any issues and I will reopen. |
That fix unfortunately doesn't help, I created a reproduction repo: https://github.com/NetForce1/requirecss-56 |
set bufferLoaded to true for loaded buffers, fixes issue when setBuffer
is called before load.