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: Cannot call method 'replace' of undefined #37

Open
sammcj opened this issue Jun 18, 2015 · 2 comments
Open

TypeError: Cannot call method 'replace' of undefined #37

sammcj opened this issue Jun 18, 2015 · 2 comments

Comments

@sammcj
Copy link

sammcj commented Jun 18, 2015

When the hook is triggered the following error occurred and the build is not triggered:

./jekyll-hook.js
connect deprecated urlencoded.verify: use body-parser module for verify node_modules/express/node_modules/connect/lib/middleware/bodyParser.js:55:21
connect deprecated multipart: use parser (multiparty, busboy, formidable) npm module instead node_modules/express/node_modules/connect/lib/middleware/bodyParser.js:56:20
connect deprecated limit: Restrict request size at location of read node_modules/express/node_modules/connect/lib/middleware/multipart.js:86:15
connect deprecated json.verify: use body-parser module for verify node_modules/express/node_modules/connect/lib/middleware/bodyParser.js:57:15
Listening on port 8080
TypeError: Cannot call method 'replace' of undefined
    at /opt/jekyll-hook/jekyll-hook.js:52:32
    at pop (/opt/jekyll-hook/node_modules/queue-async/queue.js:24:14)
    at Object.q.defer (/opt/jekyll-hook/node_modules/queue-async/queue.js:55:11)
    at port (/opt/jekyll-hook/jekyll-hook.js:45:11)
    at callbacks (/opt/jekyll-hook/node_modules/express/lib/router/index.js:164:37)
    at param (/opt/jekyll-hook/node_modules/express/lib/router/index.js:138:11)
    at pass (/opt/jekyll-hook/node_modules/express/lib/router/index.js:145:5)
    at Router._dispatch (/opt/jekyll-hook/node_modules/express/lib/router/index.js:173:5)
    at Object.router (/opt/jekyll-hook/node_modules/express/lib/router/index.js:33:10)
    at next (/opt/jekyll-hook/node_modules/express/node_modules/connect/lib/proto.js:174:15)
  • NodeJS v0.10.38
@jflasher
Copy link

Hi @sammcj , this looks like the server is just getting an unhandled event type that doesn't contain the ref property. When setting up the webhook, you may just want to select only the PushEvent which should resolve the issue.

@sfunk1x
Copy link

sfunk1x commented Aug 17, 2015

I am actually having this issue as well. My configuration:

  • centos 6 w/ nvm & node 0.12.7
  • nginx 1.8
  • Webhook on github configured to only send push event
  • I do get a 202 back from the server, but this is happening in console:
TypeError: Cannot read property 'replace' of undefined
    at /var/www/jekyll-hook/jekyll-hook.js:52:31
    at pop (/var/www/jekyll-hook/node_modules/queue-async/queue.js:24:14)
    at Object.q.defer (/var/www/jekyll-hook/node_modules/queue-async/queue.js:55:11)
    at /var/www/jekyll-hook/jekyll-hook.js:45:11
    at callbacks (/var/www/jekyll-hook/node_modules/express/lib/router/index.js:164:37)
    at param (/var/www/jekyll-hook/node_modules/express/lib/router/index.js:138:11)
    at pass (/var/www/jekyll-hook/node_modules/express/lib/router/index.js:145:5)
    at Router._dispatch (/var/www/jekyll-hook/node_modules/express/lib/router/index.js:173:5)
    at Object.router (/var/www/jekyll-hook/node_modules/express/lib/router/index.js:33:10)
    at next (/var/www/jekyll-hook/node_modules/express/node_modules/connect/lib/proto.js:174:15)

UPDATE 08/21/15: The problem was that I was 'testing' the webhook via Github's web GUI. This doesn't work, as it doesn't send all of the data that a regular push would. If you actually push some data to the repo, you'll force an execution of a webhook with a proper payload, and Jekyll-Hook will work beautifully.

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

3 participants