# \[kbn/optimizer\] running optimizer for typescript plugin result in \<exports is not defined\> error on Kibana 7.9

**URL:** <https://discuss.elastic.co/t/kbn-optimizer-running-optimizer-for-typescript-plugin-result-in-exports-is-not-defined-error-on-kibana-7-9/255612>\
**Category:** Kibana\
**Tags:** kibana-plugin-development\
**Created:** [November 17, 2020, 2:17am UTC](https://discuss.elastic.co/t/kbn-optimizer-running-optimizer-for-typescript-plugin-result-in-exports-is-not-defined-error-on-kibana-7-9/255612 "2020-11-17T02:17:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![8wlgns](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/8wlgns/32/72733_2.png) [@8wlgns](https://discuss.elastic.co/u/8wlgns)\
**Post date:** [November 17, 2020, 2:17am UTC](https://discuss.elastic.co/t/kbn-optimizer-running-optimizer-for-typescript-plugin-result-in-exports-is-not-defined-error-on-kibana-7-9/255612/1 "2020-11-17T02:17:46Z")

</div>

Hello?

I'm kind of a newbie in developing external kibana typescript plugin.  
I try to modify typescripts code and then running optimizer api. ([https://github.com/elastic/kibana/tree/master/packages/kbn-optimizer](https://github.com/elastic/kibana/tree/master/packages/kbn-optimizer)) It seem to well compiled.  
But, when I plugin install zip file to Kibana then, it occurs "exports is not defined" error ☹

This is my tsconfig.json

```auto
{
  "compilerOptions": {
    "sourceMap": true,
    "skipLibCheck": true,
    "baseUrl": ".",
    "paths": {
      "kibana": ["./kibana"],
      "ui/*": ["src/legacy/ui/public/*"],
      "test_utils/*": ["src/test_utils/public/*"]
    },
    "jsx": "react",
    "strict": true,
    "lib": [
      "esnext",
      "dom"
    ],
    "target": "es2015",
    "module": "es2015",
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "moduleResolution": "node",
    "forceConsistentCasingInFileNames": true,
    "keyofStringsOnly": true,
    "noUnusedLocals": true,
    "downlevelIteration": true,
    "importHelpers": true,
    "types": ["node", "jest", "react"]
  },
  "include": [
    "common/*",
    "server/**/*",
    "public/**/*"
  ],
  "exclude": ["node_modules", "*/node_modules/"]
}

```

May I ask some advice or solutions?

---

<div class="post-metadata">

**Author:** ![Pierre\_Gayvallet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierre_gayvallet/32/77239_2.png) [@Pierre\_Gayvallet](https://discuss.elastic.co/u/Pierre_Gayvallet)\
**Post date:** [November 18, 2020, 8:39am UTC](https://discuss.elastic.co/t/kbn-optimizer-running-optimizer-for-typescript-plugin-result-in-exports-is-not-defined-error-on-kibana-7-9/255612/2 "2020-11-18T08:39:06Z")

</div>

Our 3rd parties plugin tooling had a lot of issues in `7.9`, causing incomplete plugin zip files that Kibana was not able to read. Could you try with a `7.10` version (not only installing to, but using the 7.10 tooling to generate the plugin archive)?

---

<div class="post-metadata">

**Author:** ![8wlgns](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/8wlgns/32/72733_2.png) [@8wlgns](https://discuss.elastic.co/u/8wlgns)\
**Post date:** [November 18, 2020, 2:22pm UTC](https://discuss.elastic.co/t/kbn-optimizer-running-optimizer-for-typescript-plugin-result-in-exports-is-not-defined-error-on-kibana-7-9/255612/3 "2020-11-18T14:22:41Z")

</div>

I'll try it. It's very thank for your reply 🙂

---

<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:** [December 16, 2020, 2:22pm UTC](https://discuss.elastic.co/t/kbn-optimizer-running-optimizer-for-typescript-plugin-result-in-exports-is-not-defined-error-on-kibana-7-9/255612/4 "2020-12-16T14:22:46Z")

</div>

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