I'm now getting errors when it's trying to optimize the uuid node module. Here's the error:
ERROR in ./node_modules/uuid/dist/parse.js
│ Module parse failed: disallowed syntax found in file /kibana/plugins/custom_filter_bar/node_modules/uuid/dist/parse.js:
│ - [es2015] let/const variable declaration
│ You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
│ Error: disallowed syntax found in file /kibana/plugins/custom_filter_bar/node_modules/uuid/dist/parse.js:
│ - [es2015] let/const variable declaration
│ at parser.hooks.program.tap.program (/kibana/packages/kbn-optimizer/src/common/disallowed_syntax_plugin/disallowed_syntax_plugin.ts:64:17)
│ at SyncBailHook.eval (eval at create (/kibana/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:16)
│ at Parser.parse (/kibana/node_modules/webpack/lib/Parser.js:2280:26)
│ at doBuild.err (/kibana/node_modules/webpack/lib/NormalModule.js:482:32)
│ at runLoaders (/kibana/node_modules/webpack/lib/NormalModule.js:358:12)
│ at /kibana/node_modules/loader-runner/lib/LoaderRunner.js:373:3
│ at iterateNormalLoaders (/kibana/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
│ at Array.<anonymous> (/kibana/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
│ at Storage.finished (/kibana/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:43:16)
│ at provider (/kibana/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:79:9)
│ at /kibana/node_modules/graceful-fs/graceful-fs.js:115:16
│ at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
│ @ ./node_modules/uuid/dist/index.js 77:36-57
│ @ ./public/components/editor.js
│ @ ./public/custom_filter_bar_vis_type.tsx
│ @ ./public/plugin.ts
│ @ ./public/index.ts
I'm assuming this may be babel related since my Kibana 7.5 package.json
file has babel devDependencies
included in it. What devDependencies
do I need to include in my package.json
file for 7.8 to work with javascript let/const variables?
Here's the different scripts and dependency objects in my Kibana 7.5 package.json
file. Which one's should I include in my 7.8 package.json file for the optimizer to work?
{
"name": "custom_filter_bar",
"version": "1.0.0",
"description": "Allows user to create custom filters displayed in a filter bar",
"main": "index.js",
"kibana": {
"version": "7.5.0",
"templateVersion": "1.0.0"
},
"scripts": {
"preinstall": "node ../../preinstall_check",
"kbn": "node ../../scripts/kbn",
"es": "node ../../scripts/es",
"lint": "eslint .",
"start": "plugin-helpers start",
"test:server": "plugin-helpers test:server",
"test:browser": "plugin-helpers test:browser",
"build": "plugin-helpers build"
},
"devDependencies": {
"@elastic/eslint-config-kibana": "link:../../packages/eslint-config-kibana",
"@elastic/eslint-import-resolver-kibana": "link:../../packages/kbn-eslint-import-resolver-kibana",
"@kbn/expect": "link:../../packages/kbn-expect",
"@kbn/plugin-helpers": "link:../../packages/kbn-plugin-helpers",
"babel-eslint": "^10.0.1",
"eslint": "^5.16.0",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-jest": "^22.4.1",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-mocha": "^5.3.0",
"eslint-plugin-no-unsanitized": "^3.0.2",
"eslint-plugin-prefer-object-spread": "^1.2.1",
"eslint-plugin-react": "^7.12.4"
},
"dependencies": {
"lodash": "^4.17.20",
"uuid": "^8.3.1"
}
}