We've moved discussions to Discord

Adding chartkick fails. Is `importmap.rb` picked up?

Hi all,

I'm trying to add https://github.com/ankane/chartkick and followed the install guide to the letter, which means I created a `config/importmap.rb`. I'm running Rails 7.0.1. 

When running `bin/dev` I'm getting:

```
20:19:54 js.1     | $ node esbuild.config.js --reload                                                                                                  
20:19:54 js.1     | ✘ [ERROR] Could not resolve "chartkick"
20:19:54 js.1     |
20:19:54 js.1     |     application.js:27:7:
20:19:54 js.1     |       27 │ import "chartkick"
20:19:54 js.1     |          ╵        ~~~~~~~~~~~
20:19:54 js.1     |
20:19:54 js.1     |   You can mark the path "chartkick" as external to exclude it from the bundle, which will remove this error.
20:19:54 js.1     |
20:19:54 js.1     | ✘ [ERROR] Could not resolve "Chart.bundle"
20:19:54 js.1     |
20:19:54 js.1     |     application.js:28:7:
20:19:54 js.1     |       28 │ import "Chart.bundle"
20:19:54 js.1     |          ╵        ~~~~~~~~~~~~~~
20:19:54 js.1     |
20:19:54 js.1     |   You can mark the path "Chart.bundle" as external to exclude it from the bundle, which will remove this error.
20:19:54 js.1     |
20:19:54 js.1     | /home/harm/prj/disknotifier/app.disknotifier.com/node_modules/esbuild/lib/main.js:1557
20:19:54 js.1     |   let error = new Error(`${text}${summary}`);
20:19:54 js.1     |               ^
20:19:54 js.1     |
20:19:54 js.1     | Error: Build failed with 2 errors:
20:19:54 js.1     | application.js:27:7: ERROR: Could not resolve "chartkick"
20:19:54 js.1     | application.js:28:7: ERROR: Could not resolve "Chart.bundle"
20:19:54 js.1     |     at failureErrorWithLog (/home/harm/prj/disknotifier/app.disknotifier.com/node_modules/esbuild/lib/main.js:1557:15)
20:19:54 js.1     |     at /home/harm/prj/disknotifier/app.disknotifier.com/node_modules/esbuild/lib/main.js:1215:28
20:19:54 js.1     |     at runOnEndCallbacks (/home/harm/prj/disknotifier/app.disknotifier.com/node_modules/esbuild/lib/main.js:1005:63)
20:19:54 js.1     |     at buildResponseToResult (/home/harm/prj/disknotifier/app.disknotifier.com/node_modules/esbuild/lib/main.js:1213:7)
20:19:54 js.1     |     at /home/harm/prj/disknotifier/app.disknotifier.com/node_modules/esbuild/lib/main.js:1322:14
20:19:54 js.1     |     at /home/harm/prj/disknotifier/app.disknotifier.com/node_modules/esbuild/lib/main.js:637:9
20:19:54 js.1     |     at handleIncomingPacket (/home/harm/prj/disknotifier/app.disknotifier.com/node_modules/esbuild/lib/main.js:734:9)
20:19:54 js.1     |     at Socket.readFromStdout (/home/harm/prj/disknotifier/app.disknotifier.com/node_modules/esbuild/lib/main.js:604:7)
20:19:54 js.1     |     at Socket.emit (node:events:390:28)
20:19:54 js.1     |     at addChunk (node:internal/streams/readable:324:12) {
20:19:54 js.1     |   errors: [
20:19:54 js.1     |     {
20:19:54 js.1     |       detail: undefined,
20:19:54 js.1     |       location: {
20:19:54 js.1     |         column: 7,
20:19:54 js.1     |         file: 'application.js',
20:19:54 js.1     |         length: 11,
20:19:54 js.1     |         line: 27,
20:19:54 js.1     |         lineText: 'import "chartkick"',
20:19:54 js.1     |         namespace: '',
20:19:54 js.1     |         suggestion: ''
20:19:54 js.1     |       },
20:19:54 js.1     |       notes: [
20:19:54 js.1     |         {
20:19:54 js.1     |           location: null,
20:19:54 js.1     |           text: 'You can mark the p
```
(output clipped)

I've compared my newly created `importmap.rb` with the file created by a vanilla Rails 7 project and that looks quite different. Is that the issue? 
I don't think importmap.rb is support by JSP ATM. I've followed https://github.com/rails/importmap-rails#installation and I only end up with more errors. I think this has to do with the Procfile.dev and how it bundles/compiles (I'm really out of my depth here) JS.
Perhaps this is better served with a Github ticket: https://github.com/jumpstart-pro/jumpstart-pro/issues/215
Hi Harm, I've been trying to install chartkick on the latest version of Jumpstart but can't seem to figure out the JS side of things. How were you able to resolve this issue? I don't think the chartkick documentation installation instructions applies to Jumpstart setup.
+1 same issue
Notifications
You’re not receiving notifications from this thread.