probot: Zeit Now instructions don't appear to work

Bug Report

Current Behavior

Setup the tutorial application using https://probot.github.io/docs/hello-world/

Follow the https://probot.github.io/docs/deployment/#now instructions to deploy

It fails with:

> Error! Your `package.json` file is missing a `build` property inside the `script` property.
More details: https://zeit.co/docs/v2/advanced/platform/frequently-asked-questions#missing-build-script

Expected behavior/code It works

Environment

  • Probot version(s): 7.2.0
  • Node/npm version: [e.g. Node 8/npm 5]
MacBook-Pro-116:pytorch-probot ezyang$ node --version
v11.10.1
MacBook-Pro-116:pytorch-probot ezyang$ yarn --version
1.12.1
  • OS: OS X Mojave

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 19 (7 by maintainers)

Most upvoted comments

@ezyang I did a small POC by using Zeit Version 2 serverless deployment and It seems to be working fine for me. https://github.com/ibakshay/zeit-serverless-deployment-poc

My Reference and credits : https://github.com/tibdex/probot-serverless-now

<div> GitHub</div><div>ibakshay/zeit-serverless-deployment-poc</div><div>proof of concept on serverless deployment of probot bot in `Zeit Now` - ibakshay/zeit-serverless-deployment-poc</div>
<div> GitHub</div><div>tibdex/probot-serverless-now</div><div>πŸ€– Probot Wrapper to run GitHub Apps as Lambdas in Zeit's Now 2.0 - tibdex/probot-serverless-now</div>

To address the original post:

It is recommended to add a build script to emit html files in a public directory. These will be served as static files from ZEIT Now. If you want an blank home page, you could change your package.json to something like:

{
  "scripts": {
    "build": "mkdir public && echo 'Hello World' > public/index.html"
  }
}

Install the serverless adapter:

npm install probot-serverless-now

Then create a file /api/index.js with the following:

const { toLambda } = require('probot-serverless-now');
const app = require('./path/to/your/app.js');
module.exports = toLambda(app);

Deploy with now and then visit https://example.com/api to view your probot API.

This doesn’t seem to work for me either. I keep getting a 404

I’m trying to make this work but with the current instructions it still seems to be failing. Now return 404 when trying to access the lambda

This still does not work. I’ve been trying for a couple days now, and also tried deploying https://github.com/ibakshay/zeit-serverless-deployment-poc but API calls to the /api endpoint always return 404.

<div> GitHub</div><div>ibakshay/zeit-serverless-deployment-poc</div><div>proof of concept on serverless deployment of probot bot in `Zeit Now` - ibakshay/zeit-serverless-deployment-poc</div>

@ibakshay Regarding this repo:

If you move /app.js to /api/index.js, then you can remove both the builds key and the routes key in now.json πŸ‘

After reading some more Zeit docs, it seems that you have to put index.js in the api/ folder

Issue-Label Bot is automatically applying the label bug 🐞 to this issue, with a confidence of 0.97. Please mark this comment with πŸ‘ or πŸ‘Ž to give our bot feedback!

Links: app homepage, dashboard and code for this bot.