excid3 / jumpstart

Easily jumpstart a new Rails application with a bunch of great features by default

Home Page:http://jumpstartrails.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New app fails to boot, `Could not resolve "./application"`

andyw8 opened this issue · comments

On a new Rails 7.0.1 app, running bin/dev fails with:

10:46:36 css.1    | $ sass ./app/assets/stylesheets/application.bootstrap.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules --watch
10:46:36 js.1     | $ node esbuild.config.js --watch
10:46:36 js.1     | ✘ [ERROR] Could not resolve "./application"
10:46:36 js.1     |
10:46:36 js.1     |     controllers/index.js:1:28:
10:46:36 js.1     |       1 │ import { application } from "./application";
10:46:36 js.1     |         ╵                             ~~~~~~~~~~~~~~~
10:46:36 js.1     |
10:46:36 js.1     | error Command failed with exit code 1.

Command use to create:
rails new hello_jumpstart -d postgresql -m https://raw.githubusercontent.com/excid3/jumpstart/master/template.rb --skip-javascript

Commenting out that line allows the app to boot.

Is there no app/javascript/controllers/application.js file? I thought that was created automatically, but maybe it's not for some reason.

Update: It's due to the --skip-javascript option (which the README says to include). If I run without that, app/javascript/controllers/application.js is created and the app can boot.

Ah yes. And you know, we should probably be copying the application.js from this repo anyways.

Probably just need to add it around here: https://github.com/excid3/jumpstart/blob/master/template.rb#L123

Want to take a stab at that?

This should be fixed in 5f4a5f8 👍

Beat me to it 😁

Sometimes you just need an easy PR to finish the day off. 😎