Skip to content

Commit

Permalink
Include NODE_OPTIONS to webpacker:compile
Browse files Browse the repository at this point in the history
  • Loading branch information
mayorova committed Aug 8, 2024
1 parent 2a6349b commit 045b742
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/tasks/assets.rake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ namespace :assets do # rubocop:disable Metrics/BlockLength
end
end

# This is to fix 'error:0308010C:digital envelope routines::unsupported' in Node 18 when used with OpenSSL v3
# the proper fix should be upgrading webpack and babel-loader
task :openssl_legacy_provider do
node_options = ENV.fetch('NODE_OPTIONS', nil).to_s
ENV['NODE_OPTIONS'] = "#{node_options} --openssl-legacy-provider" unless node_options.include? "--openssl-legacy-provider"
end
Rake::Task['webpacker:compile'].enhance ['assets:openssl_legacy_provider']

namespace :precompile do
desc 'Compile assets for tests'
task :test do
Expand Down

0 comments on commit 045b742

Please sign in to comment.