usabilityhub / rails-erb-loader

Embedded Ruby (.erb) webpack loader for Ruby projects.
MIT License
103 stars 28 forks source link

rails-erb-loader encountered an unexpected error while writing to stdin: "write EPIPE" #91

Closed erickAvSanti closed 3 years ago

erickAvSanti commented 3 years ago
root@zavaleta:/home/webstore# rake assets:precompile RAILS_ENV=production
yarn install v1.22.5
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.84s.
Compiling...
Compilation failed:
Hash: 42fc777af3b4d1c6ac34
Version: webpack 4.44.1
Time: 4242ms
Built at: 09/01/2020 11:51:40 PM
 8 assets
Entrypoint application = js/application-8e25b9a32a7552174f1a.js js/application-8e25b9a32a7552174f1a.js.map
Entrypoint hello_erb = js/hello_erb-e923100a4cc16edb3f59.js js/hello_erb-e923100a4cc16edb3f59.js.map
Entrypoint website = js/website-512de1f9ba0649fe35f2.js js/website-512de1f9ba0649fe35f2.js.map
 [1] (webpack)/buildin/module.js 552 bytes {0} {2} [built]
 [3] ./app/javascript/packs/website.js 9.2 KiB {0} {2} [built]
 [4] (webpack)/buildin/global.js 905 bytes {0} [built]
 [6] ./app/javascript/packs/application.js 963 bytes {0} [built]
[10] ./app/javascript/channels/index.js 205 bytes {0} [built]
[11] ./app/javascript/channels sync _channel\.js$ 160 bytes {0} [built]
[14] ./app/javascript/packs/hello_erb.js.erb 325 bytes {1} [built] [failed] [1 error]
    + 8 hidden modules

ERROR in ./app/javascript/packs/hello_erb.js.erb
Module build failed (from ./node_modules/rails-erb-loader/index.js):
Error: spawn bin/rails EACCES
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

rails-erb-loader encountered an unexpected error while writing to stdin: "write EPIPE". Please report this to the maintainers.
PikachuEXE commented 3 years ago

Please include more info gem versions, ruby versions, related library versions... Content for ./app/javascript/packs/hello_erb.js.erb

Also please use code fence for log output next time to make it more readable

erickAvSanti commented 3 years ago

after any time, I solved that with gem 'mini_racer'

djangones commented 2 years ago

after any time, I solved that with gem 'mini_racer'

@erickAvSanti Can you elaborate a bit on how you solved it with the gem 'mini_racer'?

Are you still using erb-loader, or did you solve your problem completely differently with mini_racer now?

Because I get the same error message when using the erb-loader with webpack 5.51.1, webpacker 6.0.0.rc.5 and rails 5.2.6 on a staging system while the asset-precompile runs locally without problems.

With webpack 4.46.0/wepacker 5.4.3 there have been no problems on the staging-system.