Skip to content

Fix a result of ["ok", {"error": []}] failed, when it was clearly OK#184

Draft
francois wants to merge 1 commit into
lautis:masterfrom
Bus-com:fix-empty-error
Draft

Fix a result of ["ok", {"error": []}] failed, when it was clearly OK#184
francois wants to merge 1 commit into
lautis:masterfrom
Bus-com:fix-empty-error

Conversation

@francois

@francois francois commented Sep 3, 2021

Copy link
Copy Markdown

We upgraded Rails from 6.0.3.7 to 6.1.4.

We were receiving errors with no error message: "Uglifier::Error: ".

When I debugged the issue, I was able to find the following:

[211, 220] in vendor/bundle/ruby/2.7.0/gems/execjs-2.8.1/lib/execjs/external_runtime.rb
   211:         def exec_runtime(filename)
   212:           io = IO.popen(binary.split(' ') << filename, **(@popen_options.merge({err: [:child, :out]})))
   213:           output = io.read
   214:           io.close
   215:
=> 216:           if $?.success?
   217:             output
   218:           else
   219:             raise exec_runtime_error(output)
   220:           end
(byebug) #<Process::Status: pid 3561 exit 0>

Clearly, the output meant "all is OK", but Uglifier didn't treat it as such. I applied this patch in an effort to mitigate the issue for now.

Happy to discuss improvements I can apply to get this, or something similar, merged.

@Jaco-Pretorius

Copy link
Copy Markdown

+1 I'm also seeing this after a recent upgrade to Rails 7

@ransombriggs

Copy link
Copy Markdown

I am trying to upgrade to rails 7.1 and get this error on the trix dependency that comes with rails and this does not mean that it was okay. I dumped the javascript out and ran it through the debugger and the underlying error is the following.

TypeError: sym.definition is not a function at may_modify (execjs20241212-4149591-gqem2djs:3798:35067)

@ransombriggs

Copy link
Copy Markdown

I used a suggestion in mishoo/UglifyJS#2896 to downgrade the javascript v3.3.9 so pulled an old version and was able to build assets succesfully.

gem "uglifier", "4.1.5"

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

Successfully merging this pull request may close these issues.

3 participants