Open brodock opened 4 years ago
same for coffeescript. Problem is here https://github.com/rails/sprockets/blob/master/lib/sprockets/directive_processor.rb#L215-L217
def process_require_directive(path)
@required << resolve(path, accept: @content_type, pipeline: :self)
end
and here https://github.com/rails/sprockets/blob/master/lib/sprockets/resolve.rb#L149-L150
parsed_accept = parse_accept_options(mime_type, accept)
transformed_accepts = expand_transform_accepts(parsed_accept)
As I understood two things are wrong here
accept
option should be nil
when path has extnameThis issue is hanging for a month here so I'll try to make a PR that fixes this
Same problem here. Waiting PR.
I'll try to make a PR that fixes this
The fix is not that easy as I expected, so I shelved it and eventually forgot. I'm sorry. Don't expect me to do anything before the new year.
I tested your PR on my project and it worked correctly. In this case, I'll rollback to the latest version 3.x
Any progress on this issue @s-mage ? I suspect this is blocking ability to upgrade Rails for a lot of people. Can you share the specifics of the problem you are running into with the current open PR?
@niborg no, I didn't do anything. I was out of ideas, that's why I asked for help in the PR description. The problem is that my PR is dirty and it breaks a lot of tests. I call it dirty because it tries to use inverted_transformers
to find the source file and IMO there should be a better way to do it.
UPD: Just in case, https://github.com/rails/sprockets/pull/653 here is the PR
Sorry, but what is a PR?
I'm having the similar problem with application.js.coffee in Rails 5.0 and sprocket 4.0.2 In application.js.coffee the require is already without any extension.
#require codemirror
results in error couldn't find file 'codemirror' with type 'text/coffeescript'
the file sprockets should look for is codemirror.js
changing the application.js.coffee
extension to .js
does not fix the problem because then its unable to load .coffee
files...
edit: added a little bit more information
@MarkerDave
https://github.com/rails/sprockets/pull/653#issuecomment-828736037 changing require something.scss
to require something
helped me
Well, i didn’t find a solition :-(
krind regards,
Joost van der Linden
Skickad från min iPhöne
On 14 Jun 2021, at 16:27, Dave @.***> wrote:
I'm having the same problem with Rails 5.0 and sprocket 4.0.2
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
Is anyone still having this issue? As of 4.0.2 the standard upgrade guide works for me, combined with @s-mage's comment above to omit extensions.
Facing this now. Trying to upgrade Rails from 4.2.0 to 4.2.8. Renaming .css to .scss in project directories and adding copies of gems .css as .scss helps.
Now it's time to find a solution for .js/.coffee.
Expected behavior
application.css.scss
should work as it did in previous versions
Actual behavior
In both cases, you will get an error like:
System configuration