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

Failed to resolve module specifier 'controllers/nested_form_controller' #12

Open
SemihCag opened this issue Dec 23, 2022 · 1 comment
Open

Comments

@SemihCag
Copy link

SemihCag commented Dec 23, 2022

Hi, I am using nested_form but I have a error.

I am using rails7 and importmap (pin)

I have this error on browser console
Error
Failed to autoload controller: nested-form TypeError: Failed to resolve module specifier 'controllers/nested_form_controller'

Form is working but I want to clear this error.

Can you help me?

Importmap.rb
pin "stimulus-rails-nested-form", to: "https://ga.jspm.io/npm:[email protected]/dist/stimulus-rails-nested-form.es.js"

application.js
import NestedForm from 'stimulus-rails-nested-form'
application.register('nested-form', NestedForm)

@mirrorspock
Copy link

I have the same error in my console:
importmap.rb

pin "stimulus-rails-nested-form", to: "https://ga.jspm.io/npm:[email protected]/dist/stimulus-rails-nested-form.mjs"

and a controllers/nested_form_controller.js

import { Application } from '@hotwired/stimulus'
import NestedForm from 'stimulus-rails-nested-form'
const application = Application.start()
application.register('nested-form', NestedForm)

it works here also, but I would like to get rid of the error.

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

No branches or pull requests

2 participants