Github bot - Unexpected token ; - Glitch

83 views Asked by At

I'm trying to build my own github bot to cherry-pick pull-requests into release branches. There are several examples in Javascript/Typescript and using/not using Probot (Github) available on github:

At the moment I can successfully run my bot locally, but it's not working when deployed to Glitch.

Here's what I did

npx create-probot-app issue_greeter
? App name: issue-greeter
? Description of app: Replies with a greeting when someone opens an issue
? Which template would you like to use? basic-ts => Comment on new issues - written in TypeScript
code issue_greeter

I want this bot to reside under my organization. So while normally you would do the following:

npm start
# Visit http://localhost:3000
> Register Github app
# Visit https://github.com/settings/apps/manifest

I'm doing this manually:

Smee.io - Start new channel

  • Click Start a new channel

    • Webhook Proxy URL = https://smee.io/2TJ4whCGVUpsHdRr
    • Webhook Secret = bJpKnpXCsnhoJYU6O9Z5CEy6eSZ45tdP (random string 1)
  • Now move to the project. Copy .env.example as .env and paste the WEBHOOK_PROXY_URL and WEBHOOK_SECRET

  • Visit the Apps page under your Github Organization (https://github.com/organizations/ORGNAME/settings/apps) and click New GitHub App

New Github app

Here are all other instructions I did (and wrote down while doing them)

But for some reason my Glitch app won't start, and gives the following error:

Glitch app for github bot

There's no WEBHOOK_PROXY_URL, but a WEBHOOK_URL here (as per instructions).

/rbd/pnpm-volume/725725db-f67a-46e6-9310-065c08ff5138/node_modules/.registry.npmjs.org/lru-cache/9.1.2/node_modules/lru-cache/dist/cjs/index.js:27
        onabort;
               ^
SyntaxError: Unexpected token ;
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/rbd/pnpm-volume/725725db-f67a-46e6-9310-065c08ff5138/node_modules/.registry.npmjs.org/@octokit/auth-app/4.0.13/node_modules/@octokit/auth-app/dist-node/index.js:65:24)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)

Note that the generated bundle is already CommonJS

Node on Glitch

What's causing this. I noted somewhere that Glitch seems to be using Node 10, but since everything is locally built that shouldn't be a problem?

Also, is the SMEE-channel still used when deployed to Glitch, or is this only for development?

0

There are 0 answers