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

Route could not be found for application.css / application.js #30

Open
Mori opened this issue Oct 24, 2017 · 4 comments
Open

Route could not be found for application.css / application.js #30

Mori opened this issue Oct 24, 2017 · 4 comments

Comments

@Mori
Copy link

Mori commented Oct 24, 2017

This issue looks like a zombie of #13 (Assets are not accessible in API-only app), which was closed a year ago. I followed the advice of jam35L in that issue with no effect. Here is the log output:

Started GET "/graphiql/admin" for 10.242.2.16 at 2017-10-24 13:40:33 -0400                                                              
Processing by GraphiQL::Rails::EditorsController#show as HTML                                                                           
  Parameters: {"graphql_path"=>"/queries/admin"}                                                                                        
  Rendered /nhome/kkaplan/.rbenv/versions/2.1.7/lib/ruby/gems/2.1.0/gems/graphiql-rails-1.4.5/app/views/graphiql/rails/editors/show.html.erb (5.9ms)                                                                                                                            
Completed 200 OK in 25.0ms (Views: 24.6ms | ActiveRecord: 0.0ms)                                                                        
                                                                                                                                        
Started GET "/stylesheets/graphiql/rails/application.css" for 10.242.2.16 at 2017-10-24 13:40:34 -0400                                  
Processing by ApplicationController#routing_error as CSS                                                                                
  Parameters: {"path"=>"stylesheets/graphiql/rails/application"}                                                                        
Route could not be found for GET /stylesheets/graphiql/rails/application.css                                                            
Completed 404 Not Found in 0.5ms (ActiveRecord: 0.0ms)                                                                                  
                                                                                                                                        
Started GET "/javascripts/graphiql/rails/application.js" for 10.242.2.16 at 2017-10-24 13:40:34 -0400                                   
Processing by ApplicationController#routing_error as JS                                                                                 
  Parameters: {"path"=>"javascripts/graphiql/rails/application"}                                                                        
Route could not be found for GET /javascripts/graphiql/rails/application.js                                                             
Completed 404 Not Found in 0.2ms (ActiveRecord: 0.0ms)      

I tried running rake assets:precompile, and also tried copying the app/assets/ folder into my Rails app and then running rake assets:precompile. These didn't have an effect. I also tried copying the javascripts/ and stylesheets folders into my app's public/ folder. This prevents the Route could not be found error, but the page never loads. Should I try moving the whole engine into my app?

I'm constrained to use Rails 3.2 in this app, is that a known problem? I do have a minimal working graphql endpoint at /queries/admin, tested with curl. Any suggestions beyond those in issue #13?

Thanks!

@borakilicoglu
Copy link

borakilicoglu commented Apr 22, 2018

i had a same issue!

ActionController::RoutingError (No route matches [GET] "/javascripts/graphiql/rails/application.js"):

@alphabt
Copy link

alphabt commented Jun 5, 2019

Same with Rails 6.0.0.rc1

$ rails s
=> Booting Puma
=> Rails 6.0.0.rc1 application starting in development
=> Run `rails server --help` for more startup options
Puma starting in single mode...
* Version 3.12.1 (ruby 2.6.3-p62), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://localhost:3000
Use Ctrl-C to stop
Started GET "/graphiql" for ::1 at 2019-06-05 13:52:00 +0800
   (41.7ms)  SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
Processing by GraphiQL::Rails::EditorsController#show as HTML
  Parameters: {"graphql_path"=>"/graphql"}
  Rendering /Users/<snipped>/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/graphiql-rails-1.7.0/app/views/graphiql/rails/editors/show.html.erb
  Rendered /Users/<snipped>/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/graphiql-rails-1.7.0/app/views/graphiql/rails/editors/show.html.erb (Duration: 28.6ms | Allocations: 852)
Completed 200 OK in 44ms (Views: 38.1ms | ActiveRecord: 0.0ms | Allocations: 2572)


Started GET "/stylesheets/graphiql/rails/application.css" for ::1 at 2019-06-05 13:52:00 +0800
Started GET "/javascripts/graphiql/rails/application.js" for ::1 at 2019-06-05 13:52:00 +0800

ActionController::RoutingError (No route matches [GET] "/stylesheets/graphiql/rails/application.css"):

EDIT: My issue was I had require 'sprockets/railtie' commented out in config/application.rb. Uncommenting it fixed the issue for me.

@htmlboss
Copy link

Same issue with Rails 7.0.2, but the solution @alphabt suggested fix it for me.

@suyogtaksande
Copy link

@htmlboss please check this link, following the steps mentioned here solved my problem.

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

No branches or pull requests

5 participants