This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1295295 - uglify task fails: An error occurred while processing a template: <template function> has no method 'indexOf'
uglify task fails: An error occurred while processing a template: <template f...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: nodejs-grunt (Show other bugs)
24
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jamie Nguyen
Fedora Extras Quality Assurance
: Reopened
Depends On: 1323858
Blocks: 1307666 1307668 1307806
  Show dependency treegraph
 
Reported: 2016-01-04 01:38 EST by Dan Callaghan
Modified: 2017-01-19 01:19 EST (History)
4 users (show)

See Also:
Fixed In Version: nodejs-grunt-1.0.1-2.fc25 nodejs-grunt-1.0.1-1.fc24
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-01-19 01:19:48 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Dan Callaghan 2016-01-04 01:38:18 EST
Description of problem:
nodejs-typeahead.js fails to build in rawhide due to an error in the grunt uglify task.

Version-Release number of selected component (if applicable):
nodejs-grunt-contrib-uglify-0.5.0-3.fc24.noarch

How reproducible:
by rebuilding nodejs-typeahead.js

Steps to Reproduce:
1. Rebuild the nodejs-typeahead.js package

Actual results:
Build fails with this confusing error from grunt:

Running "uglify:bloodhound" (uglify) task
Warning: An error occurred while processing a template (Object function (obj) {
obj || (obj = {});
var __t, __p = '';
with (obj) {
__p +=
((__t = ( buildDir )) == null ? '' : __t) +
'/bloodhound.js';

}
return __p
} has no method 'indexOf'). Use --force to continue.

Aborted due to warnings.

Expected results:
Should build successfully.

Additional info:
typeahead.js has this in its Gruntfile:

    uglify: {
      options: {
        banner: '<%= banner %>',
        enclose: { 'window.jQuery': '$' }
      },  
      bloodhound: {
        options: {
          mangle: false,
          beautify: true,
          compress: false
        },
        src: files.common.concat(files.bloodhound),
        dest: '<%= buildDir %>/bloodhound.js'
      },  
      ...

It looks like the template in question is dest. I don't understand why something is calling indexOf on the unrendered template function. A real stack trace would have been nice...

This is probably caused by the lodash 2->3 transition which happened in rawhide recently. The build works fine on Fedora 23 which still has lodash 2. nodejs-grunt-contrib-uglify was just hacked in rawhide to accept the new lodash version but it probably needed more extensive patching than that.

The current version of nodejs-grunt-contrib-uglify (0.5.0) is a few years old now, the latest version (0.11.0) actually requires lodash 3 so possibly just updating to that version would fix things. That's bug 1108714.
Comment 1 Dan Callaghan 2016-02-14 17:49:10 EST
Seems like updating grunt-uglify didn't help, there is something else going wrong here...
Comment 2 Jan Kurik 2016-02-24 09:12:59 EST
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase
Comment 3 Dan Callaghan 2016-07-11 00:35:46 EDT
This turns out to be a grunt bug, because we are using old grunt (0.4.5) with newer lodash. It has been fixed upstream already in the 1.0.0 release:

https://github.com/gruntjs/grunt/commit/3cc26ba4caf9d673fddf4f4c4c4d3f2446a7d319 lib/grunt/template.js
Comment 4 Piotr Popieluch 2016-08-24 13:30:13 EDT
Seems to build fine now according to koschei, need to check if the grunt update can be backported to f25 and f24.

https://apps.fedoraproject.org/koschei/package/nodejs-typeahead.js
Comment 5 Fedora Update System 2016-09-01 17:50:19 EDT
nodejs-grunt-legacy-log-utils-1.0.0-2.fc25 nodejs-grunt-legacy-log-1.0.0-1.fc25 nodejs-grunt-legacy-util-1.0.0-2.fc25 nodejs-grunt-cli-1.2.0-1.fc25 nodejs-grunt-1.0.1-2.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-a912335c1e
Comment 6 Piotr Popieluch 2016-09-01 17:56:22 EDT
F25 update created, I'm really too short on time at the moment to build it on F24.
Comment 7 Piotr Popieluch 2016-09-01 18:03:53 EDT
Seems there is another broken dep in F25 causing this build to fail.

DEBUG util.py:421:  Error: nothing provides npm(pretty-bytes) < 0.2 needed by nodejs-maxmin-0.2.0-5.fc24.noarch
Comment 8 Fedora Update System 2016-09-02 13:57:52 EDT
nodejs-figures-1.7.0-2.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-a192028863
Comment 9 Fedora Update System 2016-09-02 14:15:12 EDT
nodejs-maxmin-2.1.0-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-d6c3bb68a2
Comment 10 Fedora Update System 2016-09-02 23:54:15 EDT
nodejs-grunt-1.0.1-2.fc25, nodejs-grunt-cli-1.2.0-1.fc25, nodejs-grunt-legacy-log-1.0.0-1.fc25, nodejs-grunt-legacy-log-utils-1.0.0-2.fc25, nodejs-grunt-legacy-util-1.0.0-2.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-a912335c1e
Comment 11 Fedora Update System 2016-09-03 21:24:16 EDT
nodejs-maxmin-2.1.0-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-d6c3bb68a2
Comment 12 Fedora Update System 2016-09-03 21:24:18 EDT
nodejs-figures-1.7.0-2.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-a192028863
Comment 13 Fedora Update System 2016-09-09 17:49:53 EDT
nodejs-maxmin-2.1.0-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.
Comment 14 Fedora Update System 2016-09-09 17:49:55 EDT
nodejs-figures-1.7.0-2.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.
Comment 15 Fedora Update System 2016-09-09 17:50:08 EDT
nodejs-grunt-1.0.1-2.fc25, nodejs-grunt-cli-1.2.0-1.fc25, nodejs-grunt-legacy-log-1.0.0-1.fc25, nodejs-grunt-legacy-log-utils-1.0.0-2.fc25, nodejs-grunt-legacy-util-1.0.0-2.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.
Comment 16 Christopher Tubbs 2016-12-06 19:14:20 EST
This needs to be fixed in F24. It's blocking js-jquery and js-jquery1 builds on that branch.
Comment 17 Fedora Update System 2016-12-07 15:45:37 EST
nodejs-figures-1.7.0-2.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-90ece6d3a9
Comment 18 Fedora Update System 2016-12-08 14:23:33 EST
nodejs-figures-1.7.0-2.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-90ece6d3a9
Comment 19 Dan Callaghan 2016-12-08 18:21:02 EST
Hmm doesn't seem like an update to nodejs-figures has any chance of fixing this bug in grunt...

Was the updated filed with the wrong bz number perhaps?
Comment 20 Piotr Popieluch 2016-12-09 09:59:36 EST
Figures is needed as dependency for upgrading grunt. Grunt update is needed to fix this issue. Instead of creating a dozen new "depends on" bugs on all needed dependencies, I just add this bug number to the updates.

I'm leaving for a long holiday, resetting "assigned to" to the package maintainer. You might want to request acl if you need this fixed soon.
Comment 21 Fedora Update System 2016-12-09 16:58:41 EST
nodejs-figures-1.7.0-2.fc24.1 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-c2029d59f3
Comment 22 Fedora Update System 2016-12-10 22:57:40 EST
nodejs-figures-1.7.0-2.fc24.1 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-c2029d59f3
Comment 23 Fedora Update System 2016-12-11 16:47:46 EST
nodejs-grunt-legacy-util-1.0.0-1.fc24 nodejs-grunt-legacy-log-utils-1.0.0-1.fc24 nodejs-grunt-legacy-log-1.0.0-1.fc24 nodejs-grunt-cli-1.2.0-1.fc24 nodejs-grunt-init-0.3.2-4.fc24 nodejs-grunt-git-authors-1.2.0-6.fc24 nodejs-grunt-1.0.1-1.fc24 nodejs-grunt-contrib-uglify-0.11.1-4.fc24 nodejs-grunt-contrib-cssmin-0.14.0-4.fc24 nodejs-maxmin-2.1.0-1.fc24 nodejs-gzip-size-3.0.0-1.fc24 nodejs-pretty-bytes-3.0.1-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-66eba7d6c7
Comment 24 Piotr Popieluch 2016-12-11 16:49:56 EST
buildroot overrides are created for all needed packages, js-jquery should build now.
Comment 25 Fedora Update System 2016-12-13 00:28:11 EST
nodejs-grunt-1.0.1-1.fc24, nodejs-grunt-cli-1.2.0-1.fc24, nodejs-grunt-contrib-cssmin-0.14.0-4.fc24, nodejs-grunt-contrib-uglify-0.11.1-4.fc24, nodejs-grunt-git-authors-1.2.0-6.fc24, nodejs-grunt-init-0.3.2-4.fc24, nodejs-grunt-legacy-log-1.0.0-1.fc24, nodejs-grunt-legacy-log-utils-1.0.0-1.fc24, nodejs-grunt-legacy-util-1.0.0-1.fc24, nodejs-gzip-size-3.0.0-1.fc24, nodejs-maxmin-2.1.0-1.fc24, nodejs-pretty-bytes-3.0.1-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-66eba7d6c7
Comment 26 Christopher Tubbs 2016-12-19 19:58:06 EST
+1 Looks like these overrides work. Can't give karma, because bodhi is borked for me right now and page won't load.

But got https://koji.fedoraproject.org/koji/taskinfo?taskID=16976698
and https://koji.fedoraproject.org/koji/taskinfo?taskID=16976720 scratch builds passing.
Comment 27 Fedora Update System 2017-01-19 01:19:45 EST
nodejs-figures-1.7.0-2.fc24.1 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.
Comment 28 Fedora Update System 2017-01-19 01:19:48 EST
nodejs-grunt-1.0.1-1.fc24, nodejs-grunt-cli-1.2.0-1.fc24, nodejs-grunt-contrib-cssmin-0.14.0-4.fc24, nodejs-grunt-contrib-uglify-0.11.1-4.fc24, nodejs-grunt-git-authors-1.2.0-6.fc24, nodejs-grunt-init-0.3.2-4.fc24, nodejs-grunt-legacy-log-1.0.0-1.fc24, nodejs-grunt-legacy-log-utils-1.0.0-1.fc24, nodejs-grunt-legacy-util-1.0.0-1.fc24, nodejs-gzip-size-3.0.0-1.fc24, nodejs-maxmin-2.1.0-1.fc24, nodejs-pretty-bytes-3.0.1-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.