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

Regression: Rake task methods override each other #131

Closed
excid3 opened this issue Sep 13, 2023 · 1 comment · Fixed by #132
Closed

Regression: Rake task methods override each other #131

excid3 opened this issue Sep 13, 2023 · 1 comment · Fixed by #132

Comments

@excid3
Copy link
Contributor

excid3 commented Sep 13, 2023

Rake task files that define methods end up in a global namespace, which means that cssbundling-rails and jsbundling-rails now conflict as they both define build_command.

https://github.com/rails/cssbundling-rails/blob/2f2945e74fb492ebecfd42fff11c0d206f67e7c0/lib/tasks/cssbundling/build.rake#L26C8-L26C8

To reproduce the issue, have a project with both cssbundling-rails and jsbundling-rails in it.

± rails css:build
yarn install v1.22.19
[1/4] 🔍  Resolving packages...
success Already up-to-date.
  Done in 0.05s.

From: /Users/chris/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/cssbundling-rails-1.3.0/lib/tasks/cssbundling/build.rake @ line 12 :

     7:     end
     8:   end
     9:
    10:   desc "Build your CSS bundle"
    11:   build_task = task :build do
 => 12:     binding.irb
    13:     command = build_command
    14:     unless system(command)
    15:       raise "cssbundling-rails: Command build failed, ensure `#{command}` runs without errors"
    16:     end
    17:   end

irb(main):001:0> method(:build_command)
=> #<Method: Object#build_command() /Users/chris/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/jsbundling-rails-1.2.0/lib/tasks/jsbundling/build.rake:27>
@jaybloke
Copy link

Also experiencing the same problem - had to revert back to jsbundling-rails 1.1.2 and cssbundling-rails 1.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants