Install new rails 7.0 app with importmaps

55 Views Asked by At

I have created a new rails 7.0 app. In my gemfile I have

gem 'importmap-rails' gem 'vite_rails'

In my config/importmap.rb I have the following

pin '@hotwired/turbo-rails', to: 'turbo.min.js', preload: true
pin '@hotwired/stimulus', to: 'stimulus.min.js', preload: true
pin '@hotwired/stimulus-loading', to: 'stimulus-loading.js', preload: true
pin_all_from 'app/javascript/controllers', under: 'controllers'
pin "bootstrap", to: "bootstrap.min.js", preload: true
pin "@popperjs/core", to: "popper.js", preload: true

In the application.js I have the following

import "@hotwired/turbo-rails";
import "controllers";
import "popper";
import "bootstrap";

When I try to load the page I get an error Failed to resolve import "@hotwired/turbo-rails" The rest of the pins are failing as well.

0

There are 0 best solutions below