thom4parisot / grunt-crx

Grunt task used to package private Chrome Extensions.
https://npmjs.com/grunt-crx
MIT License
118 stars 21 forks source link

Fatal error: Cannot read property 'length' of null #56

Closed demoive closed 9 years ago

demoive commented 9 years ago

I encounter a Fatal error: Cannot read property 'length' of null message when executing this task. It's unclear to me if the error originates within grunt-crx (possibly inside lib/crx.js?) or the crx node project or even within Grunt itself (doubtful, I suppose) so filing here for starters.

I've noticed that this has been logged before in oncletom/grunt-crx#35 which references oncletom/crx#18 which then mentions being solved by oncletom/crx#20, but these were a year ago and the problem seems to persist.

My environment: Node v0.12.2, Grunt CLI v0.1.13, and Grunt v0.4.5.

Config settings followed by its verbose output:

    crx: {
      "public": {
        src: "src/crx-app/",
        dest: "./",
        zipDest: "./",
        privateKey: "../key.pem",
         options: {
          maxBuffer: (3000 * 1024)
         }
      }
    }
Running "crx:public" (crx) task
Verifying property crx.public exists in config...OK
Files: src/crx-app/ -> ./
Reading /Users/me/Projects/Chrome/test/node_modules/grunt-crx/lib/../data/config-default.json...OK
Parsing /Users/me/Projects/Chrome/test/node_modules/grunt-crx/lib/../data/config-default.json...OK
Reading ../key.pem...OK
Reading src/crx-app/manifest.json...OK
Parsing src/crx-app/manifest.json...OK
Reading package.json...OK
Parsing package.json...OK
Fatal error: Cannot read property 'length' of null
yfr commented 9 years ago

Same for me here. Any news?

chrisirhc commented 9 years ago

Which version of grunt-crx are you using? I had this when I was on grunt-crx 0.3.2 but it was resolved after upgrading to grunt-crx 1.0.3 . Note that privateKey needs to move into options.privateKey, and you need to use a file glob for the src.

yfr commented 9 years ago

I did the update but it did not work for me. Maybe i forgot to update the config too. I just switched to using the bare crx tool with a script in grunt.

thom4parisot commented 9 years ago

Sorry you all, is it related to #44 and #58. I kind of need your help on #44 if you have time for it :-)

x1024 commented 9 years ago

I can confirm that the problem still exists, but updating to grunt-crx 1.0.3 fixes it.