audits1984: undefined method `assets' for # As we’re not using # require "sprockets/railtie" - I’ve encountered a problem with audits1984 engine:
undefined method 'assets' for #<Rails::Application::Configuration
I fixed it locally by conditional statement
initializer "audits1984.assets.precompile" do |app|
if app.config.respond_to?(:assets)
app.config.assets.precompile << "audits1984_manifest.js"
end
end
Would that be a problem to merge it into code base 🥺 ?
Cheers!
As we’re not using # require "sprockets/railtie" - I’ve encountered a problem with audits1984 engine:
undefined method 'assets' for #<Rails::Application::Configuration
I fixed it locally by conditional statement
initializer "audits1984.assets.precompile" do |app|
if app.config.respond_to?(:assets)
app.config.assets.precompile << "audits1984_manifest.js"
end
end
Would that be a problem to merge it into code base 🥺 ? Cheers!
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 18 (8 by maintainers)
Commits related to this issue
- add a patch for assets based on comments in https://github.com/basecamp/audits1984/issues/50 — committed to enginuitygroup/audits1984 by jipiboily 2 years ago
- Merge pull request #59 from enginuitygroup/v0.1.7-asset-patch add a fix for "undefined method `assets'" based on comments in #50 — committed to basecamp/audits1984 by jorgemanrubia 2 years ago
- Revert "add a fix for "undefined method `assets'" based on comments in #50" — committed to basecamp/audits1984 by jorgemanrubia 2 years ago
- Merge pull request #60 from basecamp/revert-59-v0.1.7-asset-patch Revert "add a fix for "undefined method `assets'" based on comments in #50" — committed to basecamp/audits1984 by jorgemanrubia 2 years ago
Thank you so much @rosa 🙏 🙏🙏🙏. I merged https://github.com/basecamp/audits1984/pull/61 and will release a new version with it later today.
@rosa just addressed this same problem for Mission control jobs. I’d like to use the same approach here. I’ll try to get to this but I have other things in my queue, so I’d appreciate a PR if someone feels like working on this.
We’ve had to do the same, definitely feels like something that should be fixed without forking
https://github.com/basecamp/audits1984/issues/50#issuecomment-2475775249
Hi is there any plan to release this soon?
That did it!
It appears that the CSS requests are being mistakenly routed to our react frontend, which returns the default react HTML page. I think this is probably caused by how our Nginx is setup. I can try setting this up on a more standard Rails service we have.
Does this match what a typical path should be for the CSS request?
/assets/audits1984/bulma.min-a0bcd487.css@AlicjaCyganiewicz @nicalpi @coalest @humzahkiani-JW @jipiboily, if you want to give a try at #61 please do! I hope it fixes your issues. Basically, just add
propshaftto your app with that branch.I’ll have a look, @jorgemanrubia! 🙏 Also, @jipiboily, I realised I forgot about
vite_railsin that other PR. I need to look into how that one works, as I’m not familiar with it, and see how the solution could be expanded to support it.Nice, thanks a lot @coalest. I ended up doing something similar in the end, so it’s good to know I’m not the only one with the same issue.
@nicalpi I had the same issue and had to fork the gem with that conditional. And then added the following initializer to fix the styling of the UI.