Giter VIP home page Giter VIP logo

Comments (10)

Li357 avatar Li357 commented on July 18, 2024 27

If you're experiencing the error:

Expected to find a manifest file in `app/assets/config/manifest.js` (Sprockets::Railtie::ManifestNeededError)

With Rails 6/Sprockets 4, downgrade to Sprockets 3 by adding this to your Gemfile:

gem 'sprockets', '~> 3'

And running bundle update sprockets

from graphiql-rails.

sarink avatar sarink commented on July 18, 2024 14

Update: Figured this out myself. The only thing necessary (rails 5.2.0) is to add the following lines to application.rb

require "sprockets/railtie"

config.middleware.use Rack::MethodOverride

Closing. But it might be nice to add it to the readme!

from graphiql-rails.

hdoan741 avatar hdoan741 commented on July 18, 2024 3

You don't need to downgrade sprocket, just add a manifest.js file and it'll work:
See: #13 (comment)

from graphiql-rails.

aharasta avatar aharasta commented on July 18, 2024 1

People starting new projects with Rails 6 in API mode will encounter issue @Li357 has pointed out. Thanks for the solution!

from graphiql-rails.

RobertWSaunders avatar RobertWSaunders commented on July 18, 2024 1

FYI, if you don't want to run on a lower sprockets version you can just do:

  1. Create the manifest file:

touch app/assets/config/manifest.js

  1. Add links to the GraphiQL CSS and JS files so they get loaded:
//= link graphiql/rails/application.css
//= link graphiql/rails/application.js

from graphiql-rails.

rmosolgo avatar rmosolgo commented on July 18, 2024

Glad you found a solution, and thanks for sharing it! Feel free to open a PR to the readme if you're interested.

from graphiql-rails.

Aryk avatar Aryk commented on July 18, 2024

Thanks @Li357! gem 'sprockets', '~> 3' worked!

from graphiql-rails.

JamesLivengood avatar JamesLivengood commented on July 18, 2024

For anyone getting this error, because your Rails app is API-only:
No route matches [GET] "/graphiql"
You need to temporarily update config.api_only to be false (in application.rb). Then you can re-run spring rails generate graphql:install and it will generate what you need.

It also can be done manually, by adding

gem 'graphiql-rails', group: :development

to your Gemfile and

if Rails.env.development?
  mount GraphiQL::Rails::Engine, at: "/graphiql", graphql_path: "/graphql"
end

to routes.rb

from graphiql-rails.

areph avatar areph commented on July 18, 2024

Thanks @Li357!

from graphiql-rails.

redferret avatar redferret commented on July 18, 2024

Update: Figured this out myself. The only thing necessary (rails 5.2.0) is to add the following lines to application.rb

require "sprockets/railtie"

config.middleware.use Rack::MethodOverride

Closing. But it might be nice to add it to the readme!

Can you explain why you picked this?
Reading in the docs I find this for Rack::MethodOverride

Allows the method to be overridden if params[:_method] is set. This is the middleware which supports the PUT and DELETE HTTP method types.

from graphiql-rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.