-
Notifications
You must be signed in to change notification settings - Fork 791
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
Cannot use require directive from registered transforms/preprocessors. #156
Comments
This is actually an issue with sprockets-rails. I had this same issue yesterday. The reason is, you |
oops, I mean |
You can see the test that I wrote yesterday to make sure this works here 3a7a5fe |
Thanks! This does look right, and from the Rails perspective the issue is only happening for me during the That said, I've reproduced it with some similar tests in the sprockets-es6 repo, however, these are running against sprockets 3.4.0. I'll check if these tests pass on the 3.x branch as it looks like the way that the built in processors are registered have changed from engines to transforms/preprocessors on master. I'll do a bit more sleuthing! |
It is an issue in the way sprockets-rails works that is fixed in its master version so I'm closing this one. Thanks |
@rafaelfranca I'd like to re-open this long-dead issue (is this okay?) I can open a new issue if that's preferable. gem 'sprockets', '~> 4.0.0.beta2'
gem 'sprockets-rails', github: 'rails/sprockets-rails'
gem 'babel-transpiler', '~> 0.7.0' To reproduce, clone https://github.com/matthewlehner/sprockets-es6-mime-failures I've tried to keep this as minimal as possible, and have only added the required gems to compile es6 and renamed the JavaScript entry point to |
It is fine. I'll take a look. |
Any luck? |
I went through @matthewlehner's example app. It fails to find However, when you use sprockets master, it correctly finds the issue. I did a bisect and discovered that the behavior was fixed with the changes from #255. Specifically, if I cherry-pick 4da2114 onto the v4.0.0.beta2 tag the example application works as expected. @matthewlehner could you give that a try (or just try master) to see if it works for you as well? |
@michaelherold I think you're right! I tried this again yesterday in a different app and couldn't reproduce it, but still was still broken in the example app regardless of the version of Sprockets I was using – it might have been a caching issue though, as I've noticed that the cached assets are not busted when options for the compiler are changed. |
@matthewd @schneems @rafaelfranca any updates on this? Is this working as expected? I seem to be having the same issue, but inside of a middleman app using sprockets. |
Just tested this morning. Still experiencing this in Rails 5 with Sprockets 4 beta.2, however, it seems to be fixed on master. Perhaps another beta version could be released to get this working? |
I released master with a few other fixes for 4.0.0.beta3. Give it a whirl. Let me know if the issue comes back. |
@schneems Thanks so much! 😻 Just watched your RailsConf talk about inheriting Sprockets and loved it. Thanks for the work on the 4.0 release so far! |
This is coming from my experience with sprockets-es6, which is using the recommended preprocessor/transform syntax rather than registering as an engine.
Calling
//=require somefile
will result in:sprockets-es6 is registered like this:
but changing to simple an engine fixes the behaviour:
I've opened another issue at TannerRogalsky/sprockets-es6#19, but it feels like this is an issue in the 3.x branch of Sprockets.
The text was updated successfully, but these errors were encountered: