question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple typescipt type issues: TS2305,TS2707,TS7006

See original GitHub issue

Bug Report

Current Behavior A clear and concise description of the behavior.

// Your code here
export = (app) => {
  // app.on is any type here
  app.on('check_run.created', (context) => { /* context is any here */  });
};

Expected behavior/code Typescript should not show any compiler issues

Environment

  • Probot version(s): 10.9.3
  • Node/npm version: 12
  • OS: Windows 10
  • Typescript: 4.0.3

Possible Solution

fix the type issues. 🙃

Additional context/Screenshots

see https://github.com/renovatebot/auto-cancel-actions/pull/18 for repro

Typescript compiler log

node_modules/probot/lib/context.d.ts(6,10): error TS2305: Module '"../../@octokit/webhooks/dist-types/generated/get-webhook-payload-type-from-event"' has no exported member 'All'.
node_modules/probot/lib/types.d.ts(19,38): error TS2707: Generic type 'Webhooks<T>' requires between 0 and 1 type arguments.
src/index.ts(6,32): error TS7006: Parameter 'context' implicitly has an 'any' type.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
gr2mcommented, Oct 22, 2020

new release incoming via https://github.com/probot/probot/runs/1293879273?check_suite_focus=true

<div> GitHub</div><div>probot/probot</div><div>🤖 A framework for building GitHub Apps to automate and improve your workflow - probot/probot</div>
1reaction
github-actions[bot]commented, Oct 22, 2020

🎉 This issue has been resolved in version 10.9.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript issue with using multiple types - Stack Overflow
The fundamental issue is that narrowing the type of component doesn't narrow the type of convertedProps , so TypeScript doesn't know that ...
Read more >
Handbook - Unions and Intersection Types - TypeScript
A union type describes a value that can be one of several types. We use the vertical bar ( | ) to separate...
Read more >
Allow intersection of return types and multiple type-assertions
On point 1: it may cause existing typescript code to fail to compile, but that would be because an error was found (in...
Read more >
Learn TypeScript: Complex Types Cheatsheet - Codecademy
A tuple in Typescript is declared with a fixed number of elements and hence, cannot be assigned to a tuple with a different...
Read more >
How To Use Basic Types in TypeScript | DigitalOcean
TypeScript has multiple basic types that are used as building blocks when building more complex types. In the following sections, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found