grunt-modernizr: Modernizr grunt broken?

It seems that Modernizr has a new release, which I think, breaks grunt-modernizr:

https://modernizr.com/news/modernizr-3-new-release-site

Currently, with 0.6.0, I’m getting the following:

Downloading source files
404 modernizr.load.1.5.4.js
404 modernizr-latest.js

>> Generating a custom Modernizr build
>> Uglifying
Writing assets/js/vendor/modernizr.min.js...OK

>> Wrote file to assets/js/vendor/modernizr.min.js
>> The following tests could not be downloaded
>>
>>     404 http://modernizr.com/i/js/modernizr.load.1.5.4.js
>>     404 http://modernizr.com/downloads/modernizr-latest.js
>>
>>     Check the Modulizr API for more info:
>>     https://github.com/Modernizr/modernizr.com/blob/gh-pages/i/js/modulizr.js#L15-157

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 44 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Please stop notifying people with ‘+1’ posts 😕

@patrickkettner Those links no longer working:(

I’m encountering the error with 404 modernizr-latest.js.

I was puzzled because /lib/cache/modernizr-latest.js exists after a fresh npm install. I eventually realized that the task sniffs this file’s modified timestamp, and if the file is 7 days old it tries to fetch a later version. To workaround this, I added the following to the top of my gruntfile. Feels icky but gets the job done:

;(function(){
        var path = './node_modules/grunt-modernizr/lib/cache/modernizr-latest.js';
        var contents = grunt.file.read(path);
        grunt.file.write(path,contents);
})();