Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

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

Closed
andyw8 opened this issue Jan 23, 2022 · 7 comments
Closed

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

andyw8 opened this issue Jan 23, 2022 · 7 comments

Comments

@andyw8
Copy link
Contributor

andyw8 commented Jan 23, 2022

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
Copy link
Owner

excid3 commented Jan 25, 2022

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

@andyw8
Copy link
Contributor Author

andyw8 commented Jan 25, 2022

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
Copy link
Owner

excid3 commented Jan 28, 2022

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
Copy link
Owner

excid3 commented Jan 28, 2022

Want to take a stab at that?

@excid3
Copy link
Owner

excid3 commented Jan 29, 2022

This should be fixed in 5f4a5f8 👍

@excid3 excid3 closed this as completed Jan 29, 2022
@andyw8
Copy link
Contributor Author

andyw8 commented Jan 29, 2022

Beat me to it 😁

@excid3
Copy link
Owner

excid3 commented Jan 29, 2022

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants