# Build plugin for Kibana 6.4.0

**URL:** <https://discuss.elastic.co/t/build-plugin-for-kibana-6-4-0/145884>\
**Category:** Kibana\
**Created:** [August 24, 2018, 10:17am UTC](https://discuss.elastic.co/t/build-plugin-for-kibana-6-4-0/145884 "2018-08-24T10:17:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jesusgn90](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jesusgn90/32/26998_2.png) [@jesusgn90](https://discuss.elastic.co/u/jesusgn90)\
**Post date:** [August 24, 2018, 10:17am UTC](https://discuss.elastic.co/t/build-plugin-for-kibana-6-4-0/145884/1 "2018-08-24T10:17:28Z")

</div>

Hello team, can't make my plugin works at all.

My plugin has some typescript files, also it has some imports from Kibana itself. When I use Kibana downloaded from the GitHub branch, my plugin works using --dev and without it.

My problem comes from building my zip package to use it using kibana-plugin install file:///my.zip and the error es fully related to TS files.

Here is my package.json:

```auto
{
    "name": "wazuh",
    "version": "3.5.0",
    "revision": "0403",
    "kibana": {
        "version": "6.4.0"
    },
    "description": "Wazuh app",
    "main": "index.js",
    "keywords": [
        "kibana",
        "wazuh",
        "ossec"
    ],
    "author": "Wazuh, Inc",
    "license": "GPL-2.0",
    "repository": {
        "type": "git",
        "url": "https://github.com/wazuh/wazuh-kibana-app.git"
    },
    "bugs": {
        "url": "https://github.com/wazuh/wazuh-kibana-app/issues"
    },
    "homepage": "https://www.wazuh.com/",
    "dependencies": {
        "angular-animate": "1.6.5",
        "angular-cookies": "1.6.5",
        "angular-material": "1.1.10",
        "dom-to-image": "^2.6.0",
        "install": "^0.10.1",
        "js2xmlparser": "^3.0.0",
        "json2csv": "^4.1.2",
        "needle": "^2.0.1",
        "node-cron": "^1.1.2",
        "pdfmake": "^0.1.37",
        "querystring-browser": "1.0.4",
        "simple-tail": "^1.1.0",
        "timsort": "^0.3.0",
        "winston": "3.0.0"
    },
    "devDependencies": {
        "eslint": "^5.4.0",
        "kbn-plugin-helpers": "link:../../kibana/packages/kbn-plugin-helpers",
        "typescript-eslint-parser": "^18.0.0"
    }
}

```

Usually our build process is:

```auto
cd myplugin
npm install
cd ..
zip -r myplugin.zip myplugin
kibana-plugin install file:///myplugin.zip

```

When developing I use `yarn add --dev link:../../kibana/packages/kbn-plugin-helpers` and `yarn kbn bootstrap` and it works like a charm. I can run my plugin with `yarn start` and with `./bin/kibana` (prod)

My main question, how to build my plugin zip file now?

Thanks in advance,  
Regards

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [August 24, 2018, 10:57am UTC](https://discuss.elastic.co/t/build-plugin-for-kibana-6-4-0/145884/2 "2018-08-24T10:57:18Z")

</div>

Hello,

Can you post exactly what error you are getting?

---

<div class="post-metadata">

**Author:** ![jesusgn90](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jesusgn90/32/26998_2.png) [@jesusgn90](https://discuss.elastic.co/u/jesusgn90)\
**Post date:** [August 24, 2018, 10:59am UTC](https://discuss.elastic.co/t/build-plugin-for-kibana-6-4-0/145884/3 "2018-08-24T10:59:22Z")

</div>

It seems like my ts files are not being compiled, so the kibana-plugin install procedure fails.

---

<div class="post-metadata">

**Author:** ![jesusgn90](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jesusgn90/32/26998_2.png) [@jesusgn90](https://discuss.elastic.co/u/jesusgn90)\
**Post date:** [August 24, 2018, 11:48am UTC](https://discuss.elastic.co/t/build-plugin-for-kibana-6-4-0/145884/4 "2018-08-24T11:48:57Z")

</div>

It seems like my tsconfig.json is not being applied when optimizing.

```auto
    ERROR in ./plugins/wazuh/public/kibana-integrations/kibana-visualization.js
    Module not found: Error: Can't resolve './loader' in '/usr/share/kibana/plugins/wazuh/public/kibana-integrations'
    
    ERROR in ./plugins/wazuh/public/directives/index.js
    Module not found: Error: Can't resolve './wz-welcome-card/wz-welcome-card' in '/usr/share/kibana/plugins/wazuh/public/directives'

```

Loader is a module written using TypeScript, same for wz-welcome-card. The problem is very clear from my view. My tsconfig.json is being ignored, my .ts files are not being transpiled when using kibana-plugin install.

If I use Kibana from GitHub tag v6.4.0 I can run my plugin using --dev or not using it.

---

<div class="post-metadata">

**Author:** ![jesusgn90](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jesusgn90/32/26998_2.png) [@jesusgn90](https://discuss.elastic.co/u/jesusgn90)\
**Post date:** [August 24, 2018, 11:52am UTC](https://discuss.elastic.co/t/build-plugin-for-kibana-6-4-0/145884/5 "2018-08-24T11:52:48Z")

</div>

Also my .kibana-plugin-helpers.json is as follow:

```auto
{
  "buildSourcePatterns": [
    "package.json",
    "tsconfig.json",
    "config.yml",
    "index.js",
  	"init.js",
    "server/**/*",
    "public/**/*",
    "util/**/*"
  ]
}

```

---

<div class="post-metadata">

**Author:** ![jesusgn90](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jesusgn90/32/26998_2.png) [@jesusgn90](https://discuss.elastic.co/u/jesusgn90)\
**Post date:** [August 24, 2018, 12:57pm UTC](https://discuss.elastic.co/t/build-plugin-for-kibana-6-4-0/145884/6 "2018-08-24T12:57:07Z")

</div>

Ok finally I got it working. I've compiled my ts files before using the tsconfig.json extended from Kibana, then I deleted the .ts files and that's all!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 21, 2018, 12:57pm UTC](https://discuss.elastic.co/t/build-plugin-for-kibana-6-4-0/145884/7 "2018-09-21T12:57:07Z")

</div>

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