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

add /lib/**/__ to autoload-paths #1246

Merged
merged 1 commit into from Mar 31, 2020
Merged

add /lib/**/__ to autoload-paths #1246

merged 1 commit into from Mar 31, 2020

Conversation

jywarren
Copy link
Member

Fixes #1245 i hope! cc @icarito

@codeclimate
Copy link

codeclimate bot commented Mar 31, 2020

Code Climate has analyzed commit 4c6f033 and detected 0 issues on this pull request.

View more on Code Climate.

@codecov
Copy link

codecov bot commented Mar 31, 2020

Codecov Report

Merging #1246 into main will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1246   +/-   ##
=======================================
  Coverage   72.92%   72.92%           
=======================================
  Files          40       40           
  Lines        1400     1400           
=======================================
  Hits         1021     1021           
  Misses        379      379           

@jywarren jywarren merged commit d51c1df into main Mar 31, 2020
@icarito
Copy link
Member

icarito commented Mar 31, 2020

I'm afraid this patch doesn't fix the issue in production. Still seeing:

F, [2020-03-31T21:17:42.294338 #21700] FATAL -- : [e24d0c22-71b0-4294-b500-fe91bcefd23c] NameError (uninitialized constant #<Class:0x000055d160836bc0>::Exporter

@icarito
Copy link
Member

icarito commented Mar 31, 2020

This didn't work so I tried:

    config.eager_load_paths += %W(#{config.root}/lib)
    config.enable_dependency_loading = true
    config.autoload_paths += %W(#{config.root}/lib)

and was able to trigger a build.
Unfortunately, the rest of the site came down!

With this error:

NameError: uninitialized constant Mime::JS
  lib/extensions/action_view/helpers/asset_tag_helper.rb:59:in `javascript_src_tag'
    content_tag("script", "", { "type" => Mime::JS, "src" => path_to_javascript(source, :body => body) }.merge(options))
  lib/extensions/action_view/helpers/asset_tag_helper.rb:50:in `block (2 levels) in javascript_include_tag'
    sources.map { |source| javascript_src_tag(source.to_s, options) }
  lib/extensions/action_view/helpers/asset_tag_helper.rb:50:in `map'
    sources.map { |source| javascript_src_tag(source.to_s, options) }
  lib/extensions/action_view/helpers/asset_tag_helper.rb:50:in `block in javascript_include_tag'
    sources.map { |source| javascript_src_tag(source.to_s, options) }
  lib/extensions/action_view/helpers/asset_tag_helper.rb:46:in `map'
    sources.map do |source|

So I'm reverting my "fix" but makes me think we're on the right track.

@icarito
Copy link
Member

icarito commented Mar 31, 2020

Now I tried disabling the previous change and adding:

config.autoloader = :classic

But that was the same as doing nothing.

@icarito
Copy link
Member

icarito commented Apr 1, 2020

Okay I fixed the issue by setting config.eager_load = false in config/environments/production.rb.
Will make a new PR for that.

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 this pull request may close these issues.

uninitialized constant Exporter
2 participants