Forem Creators and Builders

Cover image for Resolved: This error is something new.
Akhil Naidu
Akhil Naidu

Posted on

Resolved: This error is something new.

Updated

This issue was resolved and you can find more info in the comment section. The below screenshot also shows that this issue was resolved.

Error Resolved


I'm not sure about the reason of this error, but this might be related to assets precompiling. I'm attaching the log below for more info and I would like to have some suggestions or way forward to resolve this issue.

Error Image

 warning " > eslint-import-resolver-webpack@0.13.2" has unmet peer dependency "webpack@>=1.11.0".
       warning " > sass-loader@12.3.0" has unmet peer dependency "webpack@^5.0.0".
       warning " > storybook-addon-jsx@7.3.14" has unmet peer dependency "@storybook/channels@>= 5.x".
       warning " > storybook-addon-jsx@7.3.14" has unmet peer dependency "@storybook/components@>= 5.x".
       warning " > storybook-addon-jsx@7.3.14" has unmet peer dependency "@storybook/core-events@>= 5.x".
       warning " > storybook-addon-jsx@7.3.14" has unmet peer dependency "@storybook/theming@>= 5.x".
       warning " > storybook-addon-jsx@7.3.14" has unmet peer dependency "react@^16.2.0 || ^17.0.0".
       warning " > storybook-addon-jsx@7.3.14" has unmet peer dependency "react-dom@^16.2.0 || ^17.0.0".
       warning "storybook-addon-jsx > storybook-pretty-props@1.2.1" has unmet peer dependency "react@*".
       warning " > webpack-dev-server@3.11.2" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
       [5/6] Building fresh packages...
       [6/6] Cleaning modules...
       Done in 302.67s.
       rake aborted!
       Uglifier::Error: Unexpected token: punc (.)
--
        2257
        2258 function handleHiddenComments(commentableType){
        2259   const currentUser = userData();
        2260   const commentableAuthorIds = [];
        2261   let coAuthorIds = '';
        2262   if(commentableType === "Article"){
        2263     const articleContainer = document.querySelector('#article-show-container');
        2264     if(articleContainer){
          =>       commentableAuthorIds.push(articleContainer?.dataset?.authorId);
        2266       coAuthorIds = articleContainer?.dataset?.coAuthorIds;
        2267       if(coAuthorIds){
        2268         coAuthorIds.split(',').forEach(coAuthorId => {
        2269           commentableAuthorIds.push(coAuthorId);
        2270         });
        2271       }
        2272     }
        2273     else {
==
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/uglifier-4.2.0/lib/uglifier.rb:291:in `parse_result'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/uglifier-4.2.0/lib/uglifier.rb:221:in `run_uglifyjs'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/uglifier-4.2.0/lib/uglifier.rb:176:in `compile_with_map'
       /tmp/build/config/initializers/sprockets_uglifier_with_source_maps_compressor.rb:11:in `call'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/uglifier_compressor.rb:30:in `call'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/processor_utils.rb:84:in `call_processor'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/processor_utils.rb:66:in `block in call_processors'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/processor_utils.rb:65:in `reverse_each'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/processor_utils.rb:65:in `call_processors'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/loader.rb:182:in `load_from_unloaded'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/loader.rb:59:in `block in load'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/loader.rb:337:in `fetch_asset_from_dependency_cache'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/loader.rb:43:in `load'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/cached_environment.rb:44:in `load'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/bundle.rb:32:in `block in call'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/bundle.rb:31:in `call'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/processor_utils.rb:84:in `call_processor'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/processor_utils.rb:66:in `block in call_processors'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/processor_utils.rb:65:in `reverse_each'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/processor_utils.rb:65:in `call_processors'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/loader.rb:182:in `load_from_unloaded'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/loader.rb:59:in `block in load'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/loader.rb:337:in `fetch_asset_from_dependency_cache'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/loader.rb:43:in `load'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/cached_environment.rb:44:in `load'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/base.rb:81:in `find_asset'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/base.rb:88:in `find_all_linked_assets'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/manifest.rb:125:in `block (2 levels) in find'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:24:in `block in execute'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:47:in `block in synchronize'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:47:in `synchronize'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:47:in `synchronize'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:19:in `execute'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/promise.rb:564:in `block in realize'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:29:in `post'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/promise.rb:563:in `realize'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/promise.rb:250:in `execute'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/promise.rb:297:in `execute'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/manifest.rb:124:in `block in find'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/manifest.rb:123:in `map'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/manifest.rb:123:in `find'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/manifest.rb:169:in `compile'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-rails-3.2.2/lib/sprockets/rails/task.rb:67:in `block (3 levels) in define'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/rake/sprocketstask.rb:148:in `with_logger'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/sprockets-rails-3.2.2/lib/sprockets/rails/task.rb:66:in `block (2 levels) in define'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/honeycomb-beeline-2.7.1/lib/honeycomb/integrations/rake.rb:21:in `block in execute'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/honeycomb-beeline-2.7.1/lib/honeycomb/client.rb:62:in `start_span'
       /tmp/build/vendor/bundle/ruby/3.0.0/gems/honeycomb-beeline-2.7.1/lib/honeycomb/integrations/rake.rb:16:in `execute'
       Tasks: TOP => assets:precompile
       (See full trace by running task with --trace)

       !
       !     Precompiling assets failed.
       !
2021/11/03 17:03:15 exit status 1
2021/11/03 18:03:17 exit status 1
2021/11/03 18:03:17 exit status 1
Enter fullscreen mode Exit fullscreen mode

Discussion (3)

Collapse
djuber profile image
Daniel Uber • Edited on

@akhil we saw that exact error on our side today, as well. It was introduced about 17 hours ago, and should be resolved as of 3 hours ago (if you pull a newer docker image to restart, or refresh the repo code, this error should go away).

The underlying issue was caused by a combination of factors on our end. The javascript code managed by the rails asset pipeline doesn't use the same language translation as the javascript code managed by webpacker, and a valid js syntax for optional chaining was added to a file where it wasn't understood. Additionally, the failure did show up once we merged the pull request in, but was not caught during automated testing because contributions from external contributors are not set to automatically build new images (which would have triggered the asset precompilation step and failed, bringing attention to the issue and blocking the merge).

github.com/forem/forem/pull/14018 and github.com/forem/forem/pull/15277 were the related changes.

It should be possible to add a precompilation step to avoid this in the future. The precompilation is a required step during the image build. I'm a little surprised you would see this if you're using the quay.io container images, they should not have built or been available for download in the broken state, but if you're building from the forem repo's code, this definitely was present for about 14 hours today.

Collapse
akhil profile image
Akhil Naidu Author

I'm a little surprised you would see this if you're using the quay.io container images, they should not have built or been available for download in the broken state, but if you're building from the forem repo's code

Indeed I was building it from the Forem repo's code. And also thanks for the detailed error analysis.

Collapse
djuber profile image
Daniel Uber

Just a quick follow up - we added a required check for all PRs that should prevent this from happening again.