Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't render .html.erb homepage #464

Closed
existentialmutt opened this issue Nov 28, 2021 · 4 comments · Fixed by #523
Closed

Can't render .html.erb homepage #464

existentialmutt opened this issue Nov 28, 2021 · 4 comments · Fixed by #523
Labels
bug Something isn't working
Milestone

Comments

@existentialmutt
Copy link

Bridgetown Version:
bridgetown 1.0.0.alpha10 "Pearl"

To Reproduce

  1. Rename index.html to index.html.erb
  2. Start bridgetown and navigate to localhost:4000
  3. Expect home page, get a 500 error

I'm experiencing the issue working with the bridgetown repo here: https://github.com/existentialmutt/stimulus_web_components/tree/erb_no_work

Current behavior
navigating to localhost:4000 responds with a 500 error and logs the following to the terminal:

Errno::EISDIR (Is a directory @ io_fread - /home/rafe/code/stimulus_web_components/output/index.html):

/home/rafe/.asdf/installs/ruby/2.7.3/lib/ruby/gems/2.7.0/gems/bridgetown-core-1.0.0.alpha10/lib/bridgetown-core/rack/roda.rb:54:in `read'
/home/rafe/.asdf/installs/ruby/2.7.3/lib/ruby/gems/2.7.0/gems/bridgetown-core-1.0.0.alpha10/lib/bridgetown-core/rack/roda.rb:54:in `block in _roda_run_main_route'
/home/rafe/.asdf/installs/ruby/2.7.3/lib/ruby/gems/2.7.0/gems/roda-3.50.0/lib/roda/request.rb:497:in `always'
/home/rafe/.asdf/installs/ruby/2.7.3/lib/ruby/gems/2.7.0/gems/roda-3.50.0/lib/roda/request.rb:338:in `root'
/home/rafe/.asdf/installs/ruby/2.7.3/lib/ruby/gems/2.7.0/gems/bridgetown-core-1.0.0.alpha10/lib/bridgetown-core/rack/roda.rb:52:in `_roda_run_main_route'
/home/rafe/.asdf/installs/ruby/2.7.3/lib/ruby/gems/2.7.0/gems/roda-3.50.0/lib/roda.rb:496:in `block in _roda_handle_main_route'
/home/rafe/.asdf/installs/ruby/2.7.3/lib/ruby/gems/2.7.0/gems/roda-3.50.0/lib/roda.rb:494:in `catch'
/home/rafe/.asdf/installs/ruby/2.7.3/lib/ruby/gems/2.7.0/gems/roda-3.50.0/lib/roda.rb:494:in `_roda_handle_main_route'
/home/rafe/.asdf/installs/ruby/2.7.3/lib/ruby/gems/2.7.0/gems/roda-3.50.0/lib/roda/plugins/error_handler.rb:87:in `_roda_handle_main_route'
/home/rafe/.asdf/installs/ruby/2.7.3/lib/ruby/gems/2.7.0/gems/roda-3.50.0/lib/roda/plugins/direct_call.rb:18:in `call'
/home/rafe/.asdf/installs/ruby/2.7.3/lib/ruby/gems/2.7.0/gems/puma-5.5.2/lib/puma/configuration.rb:249:in `call'
/home/rafe/.asdf/installs/ruby/2.7.3/lib/ruby/gems/2.7.0/gems/puma-5.5.2/lib/puma/request.rb:77:in `block in handle_request'
/home/rafe/.asdf/installs/ruby/2.7.3/lib/ruby/gems/2.7.0/gems/puma-5.5.2/lib/puma/thread_pool.rb:340:in `with_force_shutdown'
/home/rafe/.asdf/installs/ruby/2.7.3/lib/ruby/gems/2.7.0/gems/puma-5.5.2/lib/puma/request.rb:76:in `handle_request'
/home/rafe/.asdf/installs/ruby/2.7.3/lib/ruby/gems/2.7.0/gems/puma-5.5.2/lib/puma/server.rb:447:in `process_client'
/home/rafe/.asdf/installs/ruby/2.7.3/lib/ruby/gems/2.7.0/gems/puma-5.5.2/lib/puma/thread_pool.rb:147:in `block in spawn_thread'

Expected behavior
The home page should load

Screenshots
N/A

Computing environment (please complete the following information):

  • OS: Ubuntu 20.04 via Windows WSL2
  • Browser Chrome
  • Browser Version Version 96.0.4664.45 (Official Build) (64-bit)
  • Ruby Version (check with ruby -v) ruby 2.7.3p183 (2021-04-05 revision 6847ee089d) [x86_64-linux]

Additional context

@existentialmutt existentialmutt added the bug Something isn't working label Nov 28, 2021
@existentialmutt
Copy link
Author

Jared helped me out on Discord. The solution is to use plain .erb extension because Bridgetown doesn't do .html.erb

@jaredcwhite
Copy link
Member

Glad to help you out, but I do plan to take a look at this at the very least so we don't spit out a scary Errno::EISDIR (Is a directory @ io_fread error message. Gotta improve the DX here :)

@existentialmutt
Copy link
Author

awesome! I agree a better error message would be helpful here.

@andrewmcodes
Copy link
Contributor

Does this still happen if you set an explicit permalink on index via frontmatter?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants