Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to compile after failure in webpack #1398

Closed
rossta opened this issue Apr 2, 2018 · 0 comments
Closed

Unable to compile after failure in webpack #1398

rossta opened this issue Apr 2, 2018 · 0 comments

Comments

@rossta
Copy link
Member

rossta commented Apr 2, 2018

Ruby: 2.3.0
node: 6.11.5
Webpacker: 3.2.0
@rails/webpacker: 3.2.0

We recently encountered an issue where a failure in webpack during a deploy left Webpacker in a bad state.

In our case, during the webpacker:compile phase of the first deployment, the webpack executable threw the following error: Error: ENOSPC: no space left on device.

After clearing up space on the device, we attempted to redeploy and got a new error during webpacker:compile, this time from Webpacker almost immediately:

01 JSON::ParserError: A JSON text must at least contain two octets!
01 /path/to/bundle/ruby/2.3.0/gems/json-1.8.6/lib/json/common.rb:155:in `initialize'
01 /path/to/bundle/ruby/2.3.0/gems/json-1.8.6/lib/json/common.rb:155:in `new'
01 /path/to/bundle/ruby/2.3.0/gems/json-1.8.6/lib/json/common.rb:155:in `parse'
01 /path/to/bundle/ruby/2.3.0/gems/webpacker-3.2.0/lib/webpacker/manifest.rb:70:in `load'
01 /path/to/bundle/ruby/2.3.0/gems/webpacker-3.2.0/lib/webpacker/manifest.rb:18:in `refresh'
01 /path/to/bundle/ruby/2.3.0/gems/webpacker-3.2.0/lib/webpacker/commands.rb:20:in `block in compile'
01 /path/to/bundle/ruby/2.3.0/gems/webpacker-3.2.0/lib/webpacker/commands.rb:19:in `tap'
01 /path/to/bundle/ruby/2.3.0/gems/webpacker-3.2.0/lib/webpacker/commands.rb:19:in `compile'
01 /path/to/bundle/ruby/2.3.0/gems/webpacker-3.2.0/lib/webpacker.rb:18:in `compile'
01 /path/to/bundle/ruby/2.3.0/gems/webpacker-3.2.0/lib/tasks/webpacker/compile.rake:25:in `block (3 levels) in <top (required)>'
01 /path/to/bundle/ruby/2.3.0/gems/webpacker-3.2.0/lib/tasks/webpacker/compile.rake:6:in `ensure_log_goes_to_stdout'
01 /path/to/bundle/ruby/2.3.0/gems/webpacker-3.2.0/lib/tasks/webpacker/compile.rake:24:in `block (2 levels) in <top (required)>'
01 /path/to/bundle/ruby/2.3.0/gems/webpacker-3.2.0/lib/tasks/webpacker/compile.rake:17:in `block in enhance_assets_precompile'
01 /path/to/bundle/ruby/2.3.0/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
01 Tasks: TOP => webpacker:compile

As it turns out, following the first deploy, the last_compilation_digest was recorded despite the webpack failure, and the contents of our packs/manifest.json was blank. The failure above occurred because Webpacker determined the compilation was fresh? and it attempted to skip compilation and jump straight to refreshing the (invalid) manifest file.

We were only able to compile successfully through Webpacker after removing one of the two files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant