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

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) It seem to well compiled.
But, when I plugin install zip file to Kibana then, it occurs "exports is not defined" error :frowning:

This is my tsconfig.json

{
  "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?

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)?

1 Like

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

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