Skip to content

Importing with !!raw-loader in dev vs prod build #58098

Description

@jloleysens

Kibana version:

Master pre and including 3d7bae4

Description

The title is my best guess at the root cause of the issue.

This PR #57563 moved XJSON language components (lexer rules and worker) to a shared folder to be used in Console, SearchProfiler and Watcher. Moving the worker script (x-pack/plugins/es_ui_shared/console_lang/ace/modes/x_json/worker/worker.js) to OSS and importing into x-pack (like in Watcher) caused issues on CI - no issues were found for local dev.

It looks like the issue was that the worker.js was being loaded as JS, not text, in the SearchProfiler functional test. A likely cause is mentioned at the bottom of the CI output here.

│ERROR browser[SEVERE] blob:http://localhost:6131/1f247ddd-5d53-4d3b-a7fa-bbcaab267764 29 Uncaught TypeError: Cannot read property 'window' of undefined

Which looks like it is complaining about this line in the worker

if (!(void 0 !== window.window && window.document || window.acequire && window.define)) {

👆🏻this could be undefined if the worker is not being loaded in its expected environment.

Current state

CI was restored by moving the worker back to x-pack and now we have two es_ui_shared folders (one in src and one in x-pack). Ideally we would want one location for shared functionality like that of XJSON so this a workaround.

Any advice or thoughts on this would be greatly appreciated.

Activity

  1. added
    Team:Kibana ManagementDev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t//
    on Feb 20, 2020
  2. elasticmachine commented on Feb 20, 2020

    @elasticmachine
    Contributor

    Pinging @elastic/es-ui (Team:Elasticsearch UI)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Team:Kibana ManagementDev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t//chorediscuss

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions