Creating custom plugin build fails with typescript enabled


(Martijn Rondeel) #1

Hi,

As per the docs, typescript support for a custom plugin can be enabled with a simple tsconfig.json file in the plugin root.

{
  // extend Kibana's tsconfig, or use your own settings
  "extends": "../../kibana/tsconfig.json",

  // tell the TypeScript compiler where to find your source files
  "include": [
    "server/**/*",
    "public/**/*"
  ]
}

However when I run yarn build now it gives me a lot of errors (about 300+) that are not related to my plugin, for example:

../../../../../kibana/src/core/public/utils/modify_url.ts:20:56 - error TS7016: Could not find a declaration file for module 'url'. '/home/martijn/Repos/kibana/node_modules/url/url.js' implicitly has an 'any' type.
  Try `npm install @types/url` if it exists or add a new declaration (.d.ts) file containing `declare module 'url';`

20 import { format as formatUrl, parse as parseUrl } from 'url';

and

../../../../../kibana/node_modules/@types/react/index.d.ts:2416:13 - error TS2717: Subsequent property declarations must have the same type.  Property 'text' must be of type 'SVGProps<SVGTextElement>', but here has type 'SVGProps<SVGTextElement>'.

2416             text: React.SVGProps<SVGTextElement>;

I'm running kibana from the 6.x branch. Any help is greatly appreciated :slight_smile:


(Martijn Rondeel) #2

(system) closed #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.