hungle00 / rondo_form

Same as Cocoon, but using StimulusJS https://rubygems.org/gems/rondo_form
MIT License
65 stars 4 forks source link

rondo form in production #5

Open czepesch opened 10 months ago

czepesch commented 10 months ago

Hello! I deploy my application via dokku (docker) to my own Hetzner VPS and have: ActionController::RoutingError (No route matches [GET] "/assets/controllers/nested_rondo_controller") browser console:

Request URL: https://pm.23.88.117.56.sslip.io/assets/nested_rondo_controller
Status Code:
404 Not Found

I already have few Stimulus controllers in the application and they are all working in the production, except rondo controller.

What additional steps should I take to make it work?

I already did asset:precompile, :clobber, :clean and such stuff, but no luck

Rails 7, importmaps, ruby "3.2.2" javascript/cotnroller/index.js:

import NestedRondoController from "./nested_rondo_controller"
application.register("nested-rondo", NestedRondoController)

Should I more specifically set a path somewhere to this controller? Thanks in advance!

UPDATE: Not sure if it is a correct approach or I found a real issue. I just commented out these lines in index.js and controller works fine in the production:

import NestedRondoController from "./nested_rondo_controller"
application.register("nested-rondo", NestedRondoController)

since this already loading all the controllers:

import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
eagerLoadControllersFrom("controllers", application)
hungle00 commented 9 months ago

I don't use VPS for deployment, it worked well when I tried to deploy on Flyio. Do you have any error when running asset:precompile? Maybe you can try renaming the stimulus controller and file names, I named nested_rondo just for convention.