excid3 / jumpstart

Easily jumpstart a new Rails application with a bunch of great features by default
http://jumpstartrails.com
MIT License
1.2k stars 316 forks source link

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

Closed andyw8 closed 2 years ago

andyw8 commented 2 years ago

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.

excid3 commented 2 years ago

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

andyw8 commented 2 years ago

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.

excid3 commented 2 years ago

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

excid3 commented 2 years ago

Want to take a stab at that?

excid3 commented 2 years ago

This should be fixed in 5f4a5f8 👍

andyw8 commented 2 years ago

Beat me to it 😁

excid3 commented 2 years ago

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