Hi Team,
We are facing the below error while embedding the react vega in kibana 8.6.2 version.
Please let you know any solution for this requirement or any fix for the below mentioned issue.
React Vega - Component
│ np bld log [20:14:06.520] [error][@kbn/optimizer] [treeVega] build
│ np bld log [20:14:06.520] [error][@kbn/optimizer] Optimizations failure.
│ 118 modules
│
│ ERROR in /home/vegatest/kibana/node_modules/vega-embed/build/vega-embed.js 4232:21
│ Module parse failed: Identifier directly after number (4232:21)
│ You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See Concepts | webpack
│ | // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
│ | const editor = window.open(url);
│ > const wait = 10_000;
│ | const step = 250;
│ | const {
│ @ /home/vegatest/kibana/node_modules/react-vega/lib/VegaEmbed.js 10:40-61
│ @ /home/vegatest/kibana/node_modules/react-vega/lib/Vega.js
│ @ /home/vegatest/kibana/node_modules/react-vega/lib/index.js
│ @ ./public/components/app.tsx
│ @ ./public/application.tsx
│ @ ./public/plugin.ts
│ @ ./public/index.ts
│ @ /home/vegatest/kibana/node_modules/@kbn/optimizer/target_node/src/worker/entry_point_creator.js
np bld log [20:14:06.520] [warning][@kbn/optimizer] worker stderr Browserslist: caniuse-lite is outdated. Please run:
np bld log [20:14:06.521] [error][@kbn/optimizer] webpack compile errors
│ np bld log [20:14:06.521] [error][@kbn/optimizer] [treeVega] build
│ np bld log [20:14:06.521] [error][@kbn/optimizer] Optimizations failure.
│ 118 modules
│
│ ERROR in /home/vegatest/kibana/node_modules/vega-embed/build/vega-embed.js 4232:21
│ Module parse failed: Identifier directly after number (4232:21)
│ You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See Concepts | webpack
│ | // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
│ | const editor = window.open(url);
│ > const wait = 10_000;
│ | const step = 250;
│ | const {
│ @ /home/vegatest/kibana/node_modules/react-vega/lib/VegaEmbed.js 10:40-61
│ @ /home/vegatest/kibana/node_modules/react-vega/lib/Vega.js
│ @ /home/vegatest/kibana/node_modules/react-vega/lib/index.js
│ @ ./public/components/app.tsx
│ @ ./public/application.tsx
│ @ ./public/plugin.ts
│ @ ./public/index.ts
│ @ /home/vegatest/kibana/node_modules/@kbn/optimizer/target_node/src/worker/entry_point_creator.js
np bld log [20:14:06.521] [warning][@kbn/optimizer] worker stderr npx update-browserslist-db@latest
Concepts | webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable of transforming, bundling, or packaging just about any resource or asset.