Skip to content

Commit

Permalink
Remove rails-erb-loader which causing to fail on AWS EC2
Browse files Browse the repository at this point in the history
- Remove pagy.js.erb file who initiates Pagy on JS
- Enable Spring when using webpacker:compile command on travis.yml file

From eb-activity.log file
---
ERROR in ./app/javascript/packs/hello_erb.js.erb
Module build failed (from ./node_modules/rails-erb-loader/index.js):
Error: rails-erb-loader failed with code: 1
    at ChildProcess.<anonymous> (/var/app/ondeck/node_modules/rails-erb-loader/index.js:128:16)
    at ChildProcess.emit (events.js:193:13)
    at maybeClose (internal/child_process.js:999:16)
    at Socket.stream.socket.on (internal/child_process.js:403:11)
    at Socket.emit (events.js:193:13)
    at Pipe._handle.close (net.js:614:12)

ERROR in ./app/javascript/lib/pagy.js.erb
Module build failed (from ./node_modules/rails-erb-loader/index.js):
Error: rails-erb-loader failed with code: 1
    at ChildProcess.<anonymous> (/var/app/ondeck/node_modules/rails-erb-loader/index.js:128:16)
    at ChildProcess.emit (events.js:193:13)
    at maybeClose (internal/child_process.js:999:16)
    at Socket.stream.socket.on (internal/child_process.js:403:11)
    at Socket.emit (events.js:193:13)
    at Pipe._handle.close (net.js:614:12)

usabilityhub/rails-erb-loader#63
rails/webpacker#1560
rails/webpacker#1529
  • Loading branch information
rokumatsumoto committed Dec 8, 2019
1 parent 665d9ac commit ea6741c
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 43 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ notifications:
rvm:
- "2.5.5"
script:
- "DISABLE_SPRING=1 bundle exec rails webpacker:compile" # https://github.com/usabilityhub/rails-erb-loader/issues/63#issuecomment-374791504
- "bundle exec rails webpacker:compile"
- "bundle exec rake db:schema:load"
- "./cc-test-reporter before-build"
- "bundle exec rspec spec"
Expand Down
6 changes: 0 additions & 6 deletions app/javascript/lib/pagy.js.erb

This file was deleted.

2 changes: 0 additions & 2 deletions app/javascript/packs/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ LocalTime.start();

import 'bootstrap/dist/js/bootstrap';

import 'lib/pagy.js.erb';

// https://github.com/DavyJonesLocker/client_side_validations/issues/767
require('@client-side-validations/client-side-validations')
require('@client-side-validations/simple-form/dist/simple-form.bootstrap4')
Expand Down
6 changes: 0 additions & 6 deletions app/javascript/packs/hello_erb.js.erb

This file was deleted.

2 changes: 0 additions & 2 deletions config/webpack/environment.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const { environment } = require('@rails/webpacker')
const erb = require('./loaders/erb')
const webpack = require('webpack')
const { VueLoaderPlugin } = require('vue-loader')
const customConfig = require('./custom')
Expand All @@ -25,5 +24,4 @@ environment.loaders.prepend('vue', vue)

environment.config.merge(customConfig)

environment.loaders.prepend('erb', erb)
module.exports = environment
11 changes: 0 additions & 11 deletions config/webpack/loaders/erb.js

This file was deleted.

1 change: 0 additions & 1 deletion config/webpacker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ default: &default
- .woff2

extensions:
- .erb
- .vue
- .mjs
- .js
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"lodash-es": "^4.17.14",
"noty": "^3.2.0-beta",
"popper.js": "^1.15.0",
"rails-erb-loader": "^5.5.2",
"rails-ujs": "^5.2.3",
"regenerator-runtime": "^0.13.3",
"resolve-url-loader": "^3.1.0",
Expand Down
13 changes: 0 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4850,11 +4850,6 @@ lodash.clonedeep@^4.5.0:
resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef"
integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=

lodash.defaults@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c"
integrity sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=

lodash.escaperegexp@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz#64762c48618082518ac3df4ccf5d5886dae20347"
Expand Down Expand Up @@ -6906,14 +6901,6 @@ querystringify@^2.1.1:
resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.1.1.tgz#60e5a5fd64a7f8bfa4d2ab2ed6fdf4c85bad154e"
integrity sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==

rails-erb-loader@^5.5.2:
version "5.5.2"
resolved "https://registry.yarnpkg.com/rails-erb-loader/-/rails-erb-loader-5.5.2.tgz#db3fa8ac89600f09d179a1a70a2ca18c592576ea"
integrity sha512-cjQH9SuSvRPhnWkvjmmAW/S4AFVDfAtYnQO4XpKJ8xpRdZayT73iXoE+IPc3VzN03noZXhVmyvsCvKvHj4LY6w==
dependencies:
loader-utils "^1.1.0"
lodash.defaults "^4.2.0"

rails-ujs@^5.2.3:
version "5.2.3"
resolved "https://registry.yarnpkg.com/rails-ujs/-/rails-ujs-5.2.3.tgz#4b65ea781a6befe62e96da6362165286a1fe4099"
Expand Down

0 comments on commit ea6741c

Please sign in to comment.