Babel translations in Kibana not working?

HI. I have a local install of Kibana v7.12.1 being used on Samsung Smart TVs, who's inbuilt browser is built on top of Chromium 56 and so spread syntax for object literals isn't supported, so when the kibana home page loads, I get a ton of javascript errors.

e.g.

home:342 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.

bootstrap.js:43 ^ A single error about an inline script not firing due to content security policy is expected!
:5601/39457/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:283 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/core/core.entry.js:6 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/licensing/licensing.plugin.js:2 Uncaught SyntaxError: Unexpected token ...      
:5601/39457/bundles/plugin/kibanaReact/kibanaReact.plugin.js:6 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/globalSearch/globalSearch.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/globalSearchProviders/globalSearchProviders.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/usageCollection/usageCollection.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/kibanaUtils/kibanaUtils.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/telemetry/telemetry.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/share/share.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/newsfeed/newsfeed.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/mapsLegacy/mapsLegacy.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/visDefaultEditor/visDefaultEditor.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/data/data.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/inspector/inspector.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/kibanaLegacy/kibanaLegacy.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/runtimeFields/runtimeFields.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/esUiShared/esUiShared.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/uiActions/uiActions.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/spacesOss/spacesOss.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/embeddable/embeddable.plugin.js:6 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/savedObjects/savedObjects.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/uiActionsEnhanced/uiActionsEnhanced.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/urlDrilldown/urlDrilldown.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/embeddableEnhanced/embeddableEnhanced.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/expressions/expressions.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/charts/charts.plugin.js:6 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/bfetch/bfetch.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/home/home.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/observability/observability.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/management/management.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/indexPatternManagement/indexPatternManagement.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/visualizations/visualizations.plugin.js:6 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/discover/discover.plugin.js:6 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/visTypeVislib/visTypeVislib.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/visTypeXy/visTypeXy.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/visTypeVega/visTypeVega.plugin.js:12 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/visTypeTimelion/visTypeTimelion.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/features/features.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/licenseManagement/licenseManagement.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/canvas/canvas.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/maps/maps.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/reporting/reporting.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/visTypeMetric/visTypeMetric.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/tileMap/tileMap.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/regionMap/regionMap.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/savedObjectsTaggingOss/savedObjectsTaggingOss.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/presentationUtil/presentationUtil.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/navigation/navigation.plugin.js:6 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/graph/graph.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/timelion/timelion.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/dashboard/dashboard.plugin.js:6 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/dashboardEnhanced/dashboardEnhanced.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/visualize/visualize.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/visTypeTimeseries/visTypeTimeseries.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/kibanaOverview/kibanaOverview.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/savedObjectsManagement/savedObjectsManagement.plugin.js:1 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/spaces/spaces.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/security/security.plugin.js:2 Uncaught SyntaxError: Unexpected token {
:5601/39457/bundles/plugin/savedObjectsTagging/savedObjectsTagging.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/globalSearchBar/globalSearchBar.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/lists/lists.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/securitySolution/securitySolution.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/fleet/fleet.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/infra/infra.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/ml/ml.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/dataEnhanced/dataEnhanced.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/snapshotRestore/snapshotRestore.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/rollup/rollup.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/remoteClusters/remoteClusters.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/crossClusterReplication/crossClusterReplication.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/indexLifecycleManagement/indexLifecycleManagement.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/enterpriseSearch/enterpriseSearch.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/beatsManagement/beatsManagement.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/ingestPipelines/ingestPipelines.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/triggersActionsUi/triggersActionsUi.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
:5601/39457/bundles/plugin/logstash/logstash.plugin.js:2 Uncaught SyntaxError: Unexpected token ...
bootstrap.js:25 Uncaught Error: __kbnBundles__ does not have a module defined for "entry/core/public"
    at Object.get (bootstrap.js:25)
    at bootstrap.js:215
    at HTMLScriptElement.innerCb (bootstrap.js:91)
get @ bootstrap.js:25
(anonymous) @ bootstrap.js:215
innerCb @ bootstrap.js:91

@babel/plugin-syntax-object-rest-spread is included in the package.json so I would have expected it to have translated the spread syntax into Object.assign() instead, but it isn't. Any suggestions of changes I can make to the base code to fix this as I really don't fancy rewriting all the uses of it manually!

Hi @neil_welling

I think that what features go into the builds is based on the .browserslistrc file. So updating that to include this specific browser and then rebuilding the bundles might get what you are looking for. Since this is not a supported browser, you might also run into further issues, but I would start with that.

Awesome - thanks @corey.robertson , I'll give it a go. It lists samsung in that file, do you if that is the TV browser, if not, I'm going to have to set Chrome to last 35 versions or something crazy :slight_smile: ?

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