[Python-modules-team] Bug#1078077: Info received (jupyterlab: Fail to get yarn configuration. node:internal/modules/cjs/loader:1148)

PICCA Frederic-Emmanuel frederic-emmanuel.picca at synchrotron-soleil.fr
Thu Aug 8 12:44:05 BST 2024


Once the right package was built.

the application doesn not work at all

the attached images shows the problem

here the source of the page

<!doctype html><html lang="en"><head><meta charset="utf-8"><title>JupyterLab</title><meta name="viewport" content="width=device-width,initial-scale=1">[object Module]<script defer="defer" src="/static/lab/main.74ec5646f1c4e4eb533e.js?v=74ec5646f1c4e4eb533e"></script></head><body><script>/* Remove token from URL. */
  (function () {
    var location = window.location;
    var search = location.search;

    // If there is no query string, bail.
    if (search.length <= 1) {
      return;
    }

    // Rebuild the query string without the `token`.
    var query = '?' + search.slice(1).split('&')
      .filter(function (param) { return param.split('=')[0] !== 'token'; })
      .join('&');

    // Rebuild the URL with the new query string.
    var url = location.origin + location.pathname +
      (query !== '?' ? query : '') + location.hash;

    if (url === location.href) {
      return;
    }

    window.history.replaceState({ }, '', url);
  })();</script></body></html>

The console indicate this error


Uncaught (in promise) TypeError: a.map is not a function
    e bootstrap.js:79
    37559 bootstrap.js:67
    Webpack 3


the source is here


void (async function bootstrap() {
  // This is all the data needed to load and activate plugins. This should be
  // gathered by the server and put onto the initial page template.
  const extension_data = getOption('federated_extensions');

  // We first load all federated components so that the shared module
  // deduplication can run and figure out which shared modules from all
  // components should be actually used. We have to do this before importing
  // and using the module that actually uses these components so that all
  // dependencies are initialized.
  let labExtensionUrl = getOption('fullLabextensionsUrl');
  const extensions = await Promise.allSettled(
    extension_data.map(async data => {
      await loadComponent(
        `${labExtensionUrl}/${data.name}/${data.load}`,
        data.name
      );
    })
  );


extension_data is null

the GetOption is not functional


let _CONFIG_DATA = null;
function getOption(name) {
  if (_CONFIG_DATA === null) {
    let configData = {};
    // Use script tag if available.
    if (typeof document !== 'undefined' && document) {
      const el = document.getElementById('jupyter-config-data');

      if (el) {
        configData = JSON.parse(el.textContent || '{}');
      }
    }
    _CONFIG_DATA = configData;
  }

  return _CONFIG_DATA[name] || '';
}

This is because the index.html file (source of the page doesn not contain the jupyter-config-data id.

It is possible to verify this hypothesis be replacing the index.html file by the one generated by the upstream when installed via pip where we replace the main.<hash> with the right one.


<!doctype html><html lang="en"><head><meta charset="utf-8"><title>JupyterLab</title><meta name="viewport" content="width=device-width,initial-scale=1">{# Copy so we do not modify the page_config with updates. #} {% set page_config_full = page_config.copy() %} {# Set a dummy variable - we just want the side effect of the update. #} {% set _ = page_config_full.update(baseUrl=base_url, wsUrl=ws_url) %}<script id="jupyter-config-data" type="application/json">{{ page_config_full | tojson }}</script>{% block favicon %}<link rel="icon" type="image/x-icon" href="{{ base_url | escape }}static/favicons/favicon.ico" class="idle favicon"><link rel="" type="image/x-icon" href="{{ base_url | escape }}static/favicons/favicon-busy-1.ico" class="busy favicon">{% endblock %}<script defer="defer" src="{{page_config.fullStaticUrl}}/main.74ec5646f1c4e4eb533e.js?v=74ec5646f1c4e4eb533e"></script></head><body><script>/* Remove token from URL. */
  (function () {
    var location = window.location;
    var search = location.search;

    // If there is no query string, bail.
    if (search.length <= 1) {
      return;
    }

    // Rebuild the query string without the `token`.
    var query = '?' + search.slice(1).split('&')
      .filter(function (param) { return param.split('=')[0] !== 'token'; })
      .join('&');

    // Rebuild the URL with the new query string.
    var url = location.origin + location.pathname +
      (query !== '?' ? query : '') + location.hash;

    if (url === location.href) {
      return;
    }

    window.history.replaceState({ }, '', url);
  })();</script></body></html>

and now the sceenshot :).


at least  with this the application start to become usefull.




-------------- next part --------------
A non-text attachment was scrubbed...
Name: Capture d??cran du 2024-08-08 13-41-42.png
Type: image/png
Size: 149439 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/python-modules-team/attachments/20240808/bf763ae2/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Capture d??cran du 2024-08-08 13-26-55.png
Type: image/png
Size: 22834 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/python-modules-team/attachments/20240808/bf763ae2/attachment-0003.png>


More information about the Python-modules-team mailing list