tablecheck / dartsass-sprockets

Integrate Dart Sass with Sprockets (Ruby on Rails asset pipeline)
MIT License
35 stars 5 forks source link

tsort.rb:230:in `block in tsort_each': topological sort failed #9

Closed rgaufman closed 1 year ago

rgaufman commented 1 year ago

I replaced:

gem 'sass-rails'

With:

gem 'dartsass-sprockets'

I ran bundle update, but when I try to start rails I get:

$ rails s
/opt/homebrew/lib/ruby/gems/3.2.0/gems/dartsass-sprockets-3.0.0/lib/sassc/rails/version.rb:5: warning: already initialized constant SassC::Rails::VERSION
/opt/homebrew/lib/ruby/gems/3.2.0/gems/sassc-rails-2.1.2/lib/sassc/rails/version.rb:5: warning: previous definition of VERSION was here
/opt/homebrew/lib/ruby/gems/3.2.0/gems/dartsass-sprockets-3.0.0/lib/sassc/rails/importer.rb:75: warning: already initialized constant SassC::Rails::Importer::EXTENSIONS
/opt/homebrew/lib/ruby/gems/3.2.0/gems/sassc-rails-2.1.2/lib/sassc/rails/importer.rb:75: warning: previous definition of EXTENSIONS was here
/opt/homebrew/lib/ruby/gems/3.2.0/gems/dartsass-sprockets-3.0.0/lib/sassc/rails/importer.rb:86: warning: already initialized constant SassC::Rails::Importer::PREFIXS
/opt/homebrew/lib/ruby/gems/3.2.0/gems/sassc-rails-2.1.2/lib/sassc/rails/importer.rb:86: warning: previous definition of PREFIXS was here
/opt/homebrew/lib/ruby/gems/3.2.0/gems/dartsass-sprockets-3.0.0/lib/sassc/rails/importer.rb:87: warning: already initialized constant SassC::Rails::Importer::GLOB
/opt/homebrew/lib/ruby/gems/3.2.0/gems/sassc-rails-2.1.2/lib/sassc/rails/importer.rb:87: warning: previous definition of GLOB was here
=> Booting Puma
=> Rails 7.0.4.3 application starting in development
=> Run `bin/rails server --help` for more startup options
Exiting
/opt/homebrew/Cellar/ruby/3.2.2/lib/ruby/3.2.0/tsort.rb:230:in `block in tsort_each': topological sort failed: [#<Rails::Initializable::Initializer:0x000000010f4f6680 @name=:setup_compression, @context=#<SassC::Rails::Railtie>, @options={:group=>:all, :after=>:setup_sass}, @block=#<Proc:0x00000001186fb3f0 /opt/homebrew/lib/ruby/gems/3.2.0/gems/sassc-rails-2.1.2/lib/sassc/rails/railtie.rb:72>>, #<Rails::Initializable::Initializer:0x000000010f4f65e0 @name=:setup_sass, @context=#<SassC::Rails::Railtie>, @options={:group=>:all, :after=>:setup_compression}, @block=#<Proc:0x000000010a4582a0 /opt/homebrew/lib/ruby/gems/3.2.0/gems/dartsass-sprockets-3.0.0/lib/sassc/rails/railtie.rb:34>>, #<Rails::Initializable::Initializer:0x000000010f4f6540 @name=:setup_compression, @context=#<SassC::Rails::Railtie>, @options={:group=>:all, :after=>:setup_sass}, @block=#<Proc:0x000000010a453188 /opt/homebrew/lib/ruby/gems/3.2.0/gems/dartsass-sprockets-3.0.0/lib/sassc/rails/railtie.rb:72>>] (TSort::Cyclic)
    from /opt/homebrew/Cellar/ruby/3.2.2/lib/ruby/3.2.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
    from /opt/homebrew/Cellar/ruby/3.2.2/lib/ruby/3.2.0/tsort.rb:431:in `each_strongly_connected_component_from'
    from /opt/homebrew/Cellar/ruby/3.2.2/lib/ruby/3.2.0/tsort.rb:349:in `block in each_strongly_connected_component'
    from /opt/homebrew/Cellar/ruby/3.2.2/lib/ruby/3.2.0/tsort.rb:347:in `each'
    from /opt/homebrew/Cellar/ruby/3.2.2/lib/ruby/3.2.0/tsort.rb:347:in `call'
    from /opt/homebrew/Cellar/ruby/3.2.2/lib/ruby/3.2.0/tsort.rb:347:in `each_strongly_connected_component'
    from /opt/homebrew/Cellar/ruby/3.2.2/lib/ruby/3.2.0/tsort.rb:226:in `tsort_each'
    from /opt/homebrew/Cellar/ruby/3.2.2/lib/ruby/3.2.0/tsort.rb:205:in `tsort_each'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/railties-7.0.4.3/lib/rails/initializable.rb:60:in `run_initializers'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/railties-7.0.4.3/lib/rails/application.rb:372:in `initialize!'
    from /Users/hackeron/Development/TetherX/tetherx/config/environment.rb:5:in `<main>'
    from config.ru:3:in `require_relative'
    from config.ru:3:in `block in <main>'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/rack-2.2.6.4/lib/rack/builder.rb:116:in `eval'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/rack-2.2.6.4/lib/rack/builder.rb:116:in `new_from_string'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/rack-2.2.6.4/lib/rack/builder.rb:105:in `load_file'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/rack-2.2.6.4/lib/rack/builder.rb:66:in `parse_file'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/rack-2.2.6.4/lib/rack/server.rb:349:in `build_app_and_options_from_config'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/rack-2.2.6.4/lib/rack/server.rb:249:in `app'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/rack-2.2.6.4/lib/rack/server.rb:422:in `wrapped_app'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/rails_semantic_logger-4.12.0/lib/rails_semantic_logger/extensions/rails/server.rb:10:in `log_to_stdout'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/railties-7.0.4.3/lib/rails/commands/server/server_command.rb:36:in `start'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/railties-7.0.4.3/lib/rails/commands/server/server_command.rb:143:in `block in perform'
    from <internal:kernel>:90:in `tap'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/railties-7.0.4.3/lib/rails/commands/server/server_command.rb:134:in `perform'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/railties-7.0.4.3/lib/rails/command/base.rb:87:in `perform'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/railties-7.0.4.3/lib/rails/command.rb:48:in `invoke'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/railties-7.0.4.3/lib/rails/commands.rb:18:in `<main>'
    from <internal:/opt/homebrew/Cellar/ruby/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
    from <internal:/opt/homebrew/Cellar/ruby/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
    from bin/rails:4:in `<main>'
$ 

Any ideas?

johnnyshields commented 1 year ago

Yes, you are still loading the sassc-rails-2.1.2 gem. You need to remove this. If it is being loaded as the dependency of another gem, please fork that gem to remove the dependency, and/or raise a PR to that gem to upstream using dartsass-sprockets.

Closing issue.