Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError Exception thrown #1

Closed
thom4parisot opened this issue Jan 9, 2012 · 4 comments
Closed

TypeError Exception thrown #1

thom4parisot opened this issue Jan 9, 2012 · 4 comments

Comments

@thom4parisot
Copy link
Owner

Hello,

I try to package an extension through your module but it throws error on almost all configurations I try.
In my extension directory, I have 2 things:

  • key.pem
  • src/ in which I have all html, css and js files

When I type, following your example, crx pack src/ -p key.pem -f, this error is shown:

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
TypeError: Not a string or buffer
    at [object Object].generateSignature (/usr/local/lib/node_modules/crx/src/crx.js:110:10)
    at [object Object]. (/usr/local/lib/node_modules/crx/src/crx.js:23:16)
    at [object Object]. (/usr/local/lib/node_modules/crx/src/crx.js:122:26)
    at exithandler (child_process.js:276:7)
    at Array.0 (child_process.js:292:7)
    at EventEmitter._tickCallback (node.js:192:40)

However, when I package using Chrome, it is successful (such as the extension install):

/path/to/Google\ Chrome --pack-extension=./src/ --pack-extension-key=./key.pem
node --version
v0.6.2

crx --version
0.2.0
@jed
Copy link
Contributor

jed commented Jan 9, 2012

it looks like this if failing when the contents are loaded using the zip command. are you sure zip is installed on your machine, and that it works properly? if you can, try running zip -qr -9 -X - . -x key.pem and see if it creates the archive successfully.

@jed jed closed this as completed Jan 9, 2012
@thom4parisot
Copy link
Owner Author

Hi,

I used zip -qr -9 -X - ./src/ -x key.pem > src.crx otherwise I had an error (zip error: Invalid command arguments (cannot write zip file to terminal)).

which zip
/usr/bin/zip

It packaged properly into src.crx file.

@jed
Copy link
Contributor

jed commented Jan 11, 2012

hmm, i seem to have introduced a regression during my last refactor. may apologies. i'll look into it today, but for now the programatic interface should be working, so give that a shot.

@thom4parisot
Copy link
Owner Author

Cool thanks. For notice, even if I have the error, the crx is created but with a 0KB size.

I started to dig in the code but I haven't noticed where the problem was located.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants