notebook/bin/webpack
Andrew Brown 0ec141b2bb Fix Logger constant error in webpack script
Add require 'logger' to bin/webpack before requiring webpacker.
The webpack script runs as a separate Ruby process and doesn't load
Rails initializers, so the Logger fix needs to be applied directly
in the script.

This resolves the production compilation error:
uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-29 01:15:51 -07:00

23 lines
561 B
Ruby
Executable File

#!/usr/bin/env ruby
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
ENV["NODE_ENV"] ||= "development"
require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
require "bundler/setup"
# Fix for Ruby 3.2+ with Rails 6.1 and Webpacker
# Resolves: uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger
require "logger"
require "webpacker"
require "webpacker/webpack_runner"
APP_ROOT = File.expand_path("..", __dir__)
Dir.chdir(APP_ROOT) do
Webpacker::WebpackRunner.run(ARGV)
end