Error: rails-erb-loader failed with code: 1
See original GitHub issueRunning the following:
ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/swathishah/shopify-app/bin/spring rails --trace assets:precompile
But I randomly get following error:
ERROR in ./app/javascript/components/layout_tab.js.erb
Module build failed: Error: rails-erb-loader failed with code: 1
at ChildProcess.<anonymous> (/Users/swathishah/shopify-app/node_modules/rails-erb-loader/index.js:108:16)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:886:16)
at Socket.<anonymous> (internal/child_process.js:342:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:501:12)
@ ./app/javascript/components/tabs.js 12:0-44
@ ./app/javascript/packs/notifications_react.jsx
Package.json has following:
{
"name": "shopify-app",
"private": true,
"dependencies": {
"@rails/webpacker": "^3.2.1",
....
"rails-erb-loader": "^5.4.1",
...
"yarn": "^1.3.2"
},
"devDependencies": {
"webpack-dev-server": "^2.11.1"
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:9
- Comments:81 (1 by maintainers)
Top Results From Across the Web
Rails Webpacker : rails-erb-loader failing parsing .html.erb
I created a loader definition html_erb.js module.exports = { test: /\.html.erb$/, loader: [ 'rails-erb-loader', 'html-loader' ] };.
Read more >SylarRuby - Hotwire Discussion
Uncaught Error: Module build failed (from ./node_modules/rails-erb-loader/index.js): Error: rails-erb-loader failed with code: 1.
Read more >Error: rails-erb-loader failed with code: 1 - Bountysource
Running the following: ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/swathishah/shopify-app/bin/spring rails ...
Read more >rails-erb-loader - npm
rails -erb-loader. 5.5.2 • Public • Published 4 years ago. Readme · Code Beta · 2 Dependencies · 3 Dependents · 18 Versions ......
Read more >ruby-pagy/Lobby - Gitter
node_modules/rails-erb-loader/index.js): Error: rails-erb-loader failed with code: 1. Domizio Demichelis. @ddnexus. ok, so please, debug that first.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
Top Related Hashnode Post
No results found
Top GitHub Comments
We had a similar problem with
erb-loader
on CircleCI. Everything worked fine locally but failed to build on CircleCi.I sshed into CI job and ran
$ cat app/javascript/vendor/javascripts/smart_listing/smart_listing.coffee.erb | bin/rails runner ./node_modules/rails-erb-loader/erb_transformer.rb __RAILS_ERB_LOADER_DELIMETER__ erb
for my
.erb
file. But it was giving me an error that rake was not found. It was an issue with spring. Disabling spring for the job worked.So in our case it was
DISABLE_SPRING=1 bin/webpack
Link to the spring issue. https://github.com/rails/spring/pull/546
I’ve come across this error as well. In my case, the Rails Runner script was invoked with the global Ruby installation, not my local rbenv version.
bin/rails
has the default shebang (#!/usr/bin/env ruby
), which works in my default shell, but obviously not withspawn
?The error message I got was
followed by
I’m still running Webpacker 2.0, so I could just modify my
config/webpacker/loaders/erb.js
:I don’t know, however, why this became a problem today. When working on the very same project on the same machine last week, the webpack was built without hickups…