Skip to content

uninitialized constant ReactOnRails::Configuration::Webpacker #1621

@adriangohjw

Description

@adriangohjw

Environment

Ruby version: 3.3.1
Rails version: 7.1.3.2
Shakapacke version: 8.0.0
React on Rails version: 14.0.0

Expected behavior

Running rails s should start the server successfully

Actual behavior

Facing this error and server refuse to start up

.rbenv/versions/3.3.1/lib/ruby/gems/3.3.0/gems/react_on_rails-14.0.0/lib/react_on_rails/configuration.rb:261:in `shakapacker_precompile?': uninitialized constant ReactOnRails::Configuration::Webpacker (NameError)

Webpacker.config.shakapacker_precompile?

Details

Changing Webpacker.config.shakapacker_precompile? to Shakapacker.config.shakapacker_precompile? seem to fix the issue (on my end, at least)

def shakapacker_precompile?
return Webpacker.config.webpacker_precompile? if ReactOnRails::WebpackerUtils.using_shakapacker_6?
Webpacker.config.shakapacker_precompile?
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions