I’ve been using hanami 2.1.0rc for a while and had successfully worked with hanami assets. However after switching to full 2.1.0 version it all kinda exploded.
I am using the same file structure, and hanami assets watch task to compile.
My assets are all in a slice called main, js entrypoint is in slices/main/assets/js/app.js
, it loads an app.css
file and does some other minor stuff. It used to work nicely, but now when I run assets watch task from procfile I am getting an error:
Hanami::Assets::ManifestMissingError at /
it is searching under:
/home/mrimp/workspace/libus/public/assets/_main/assets.json"
Which according to the documentation is the correct path, with the main
with underscore. However this is not the file structure I am getting.
My manifest is directly in public/ folder so it is public/assets.json
. Then there is a assets folder next to it, in it I have my fonts, images etc, but also a folder called main
(no underscore). In it there is app.js
and app.css
This is my Procfile:
web: bundle exec hanami server
assets: bundle exec hanami assets watch
sidekiq: bundle exec sidekiq -r ./config/boot.rb
app.js
import "../css/app.css";
import "../css/tailwind.css";
import 'htmx.org';
import './htmx.js';
document.addEventListener('DOMContentLoaded', function () {
there is a code that loads a dark theme etc. not really relevant
});
and config/assets.js
import * as assets from "hanami-assets";
await assets.run();
I tried moving the assets outside the slice, into app/ but manifest is still not found and generated in a wrong place. What could be the reason for it? Why is the manifest generated in the wrong place? Can I even customize where it looks for it? Cause the contents of the manifest file look ok.