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'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?
Notifications
You’re not receiving notifications from this thread.