Comments (9)
TLDR: change config/environments/production.rb
(and config/environments/staging.rb
) from config.assets.js_compressor = :uglifier
to config.assets.js_compressor = Uglifier.new(harmony: true)
fix this issue
More details:
From 3eb2491, we changed reactjs from 16.0.0 to 16.2.0 which cause this facebook/react#12434
I tested with @savybrandt comment to change production.rb from config.assets.js_compressor = :uglifier
to config.assets.js_compressor = Uglifier.new(harmony: true)
and it is working fine.
Thanks @erwanthomas for the Dockerfile, very helpful to debug and change the gem version around, this is the modified version to show it works.
FROM ruby:2.5.1-alpine3.7
RUN apk add --no-cache build-base sqlite-dev tzdata nodejs=8.9.3-r1
ENV RAILS_VERSION 5.2.0
RUN gem install rails --version "$RAILS_VERSION"
ENV RAILS_ENV production
RUN rails new --database=sqlite3 dummy_app && cd dummy_app
WORKDIR /dummy_app
RUN echo 'gem "graphiql-rails", "1.4.10"' >> Gemfile && bundle
RUN sed -i -e 's/config.assets.js_compressor = :uglifier/config.assets.js_compressor = Uglifier.new(harmony: true) /g' config/environments/production.rb
RUN bundle exec rake assets:precompile
from graphiql-rails.
I encountered the same problem with graphiql-rails
1.4.10
. Falling back to 1.4.8
works around the problem for me.
from graphiql-rails.
Setting config.assets.js_compressor = Uglifier.new(harmony: true)
also worked from me.
from graphiql-rails.
It works for me until version 1.4.8
of graphiql-rails
and fails for 1.4.9
and 1.4.10
.
So some changes in the path graphiql-rails/app/assets/javascripts/graphiql/rails/
may cause the issue.
Ruby: 2.5.1
Rails: 5.2.0
uglifier: 4.1.10
from graphiql-rails.
It works for me until version
1.4.8
ofgraphiql-rails
and fails for1.4.9
and1.4.10
.
So some changes in the pathgraphiql-rails/app/assets/javascripts/graphiql/rails/
may cause the issue.
Ruby: 2.5.1
Rails: 5.2.0
uglifier: 4.1.10
It works for me!
from graphiql-rails.
I'm also experiencing this issue ^
from graphiql-rails.
Sorry to hear it! It looks like uglify is choking on some of the GraphiQL assets. You could debug further by trying to figure out which minified code is causing problems. Also, you could try adjusting the version/settings of uglify, or by updating our GraphiQL version (if a new one is available?) to see if the newer version doesn't have that trouble.
from graphiql-rails.
I've tried updating GraphiQL (using the dedicated Rake task), and the issue remains.
I've also tried requiring different combinations of assets in graphiql-rails' application.js
. There isn't a single asset responsible for the failure: it happens only when the compilation requires some specific combinations, and each asset taken separately can be compiled without errors. Therefore I'll try to focus the debugging on Uglifier, rather than on graphiql-rails or GraphiQL.
Thanks for your help, feel free to close the issue if you think it's no longer relevant to this project.
from graphiql-rails.
Hey, I hope that the fix recommended above worked. If anyone encounters this on a new version, please open a new issue!
from graphiql-rails.
Related Issues (20)
- der
- Graphql query execute is getting freeze from model callbacks HOT 1
- Build issue when bumping graphiql-rails from 1.8.0 to 1.9.0 HOT 7
- doesn't work with propshaft HOT 2
- Using themes/custom CSS
- uninitialized constant GraphiQL (NameError) HOT 1
- Add Basic Auth option HOT 1
- AbstractController::ActionNotFound (The action 'execute' could not be found for GraphqlController): HOT 1
- AssetNotPrecompiled error with Sprockets 4.0 HOT 27
- How to use this gem with graphql subscription? HOT 1
- default context variables HOT 1
- GraphiQL::Rails::EditorsController#show raising on new Rails 6 app HOT 3
- Question about request header configuration with initializer HOT 1
- Using GraphiQL in your Rails app without this gem HOT 7
- uninitialized constant GraphqlController::GraphQLIntroSchema Did you mean? GraphQlIntroSchema HOT 1
- Is this gem dead? HOT 1
- Support for subscriptions HOT 3
- headerEditorEnabled config HOT 1
- sass not needed anymore? HOT 2
- Your application has sessions disabled HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphiql-rails.