importmap and 6.1.4.1
coder2000 opened this issue · 2 comments
coder2000 commented
I am using Rails 6.1.4.1 for this app still and get an AssetNotPrecompiled
error for each of the JS files in the gem. I have been able to get it working though by using a CDN import and doing the following:
import Chartkick from "chartkick";
import { Chart, registerables } from "chart.js"
Chart.register(...registerables);
Chartkick.use(Chart)
ankane commented
Hey @coder2000, can you try forking and moving the if defined?(Importmap)
inside the initializer block to see if that fixes it?
chartkick/lib/chartkick/engine.rb
Lines 6 to 10 in a953fde
coder2000 commented
Yeah, removing if defined?(Importmap)
works.