ember-cli / broccoli-asset-rev

Broccoli plugin to add fingerprint checksums and CDN URLs to your assets
MIT License
86 stars 83 forks source link

TypeError: Cannot read property '1' of null #77

Closed hamann closed 8 years ago

hamann commented 9 years ago

This happens only when generateRailsManifest is set to true

Brocfile.js

if (env === 'production') {
  allAssets = new AssetRev(allAssets, {
    extension: ['js', 'css', 'png', 'jpg', 'gif', 'csv', 'map'],
    replaceExtension: ['js', 'css'],
    generateRailsManifest: true,
    generateAssetMap: true,
    prepend: 'https://foobarbaz.cloudfront.net/'
  });
}

module.exports = allAssets
hamann@iMac ~/workspace/boldpoker/boldpoker.net (broccoli⚡ )» node -v
v4.1.1
hamann@iMac ~/workspace/boldpoker/boldpoker.net (broccoli⚡ )» npm -v
3.3.3
hamann@iMac ~/workspace/boldpoker/boldpoker.net (broccoli⚡ )» rm -fr priv/static && BROCCOLI_ENV=production node_modules/broccoli-cli/bin/broccoli build priv/static
TypeError: Cannot read property '1' of null
  at Fingerprint.writeRailsManifest (/Users/hamann/workspace/boldpoker/boldpoker.net/node_modules/broccoli-asset-rev/lib/fingerprint.js:148:55)
  at /Users/hamann/workspace/boldpoker/boldpoker.net/node_modules/broccoli-asset-rev/lib/fingerprint.js:180:12
  at lib$rsvp$$internal$$tryCatch (/Users/hamann/workspace/boldpoker/boldpoker.net/node_modules/rsvp/dist/rsvp.js:493:16)
  at lib$rsvp$$internal$$invokeCallback (/Users/hamann/workspace/boldpoker/boldpoker.net/node_modules/rsvp/dist/rsvp.js:505:17)
  at lib$rsvp$$internal$$publish (/Users/hamann/workspace/boldpoker/boldpoker.net/node_modules/rsvp/dist/rsvp.js:476:11)
  at lib$rsvp$asap$$flush (/Users/hamann/workspace/boldpoker/boldpoker.net/node_modules/rsvp/dist/rsvp.js:1198:9)
  at doNTCallback0 (node.js:407:9)
  at process._tickCallback (node.js:336:13)

Build failed
hamann commented 9 years ago

After adding some printfs the fingerprintedPath before build fails is assets/assetMap.json

rickharrison commented 8 years ago

Please test with the newest version and let me know if you are still getting this.