Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing global variable in the Window interface #679

Open
ManonMarchand opened this issue Aug 24, 2023 · 4 comments
Open

Missing global variable in the Window interface #679

ManonMarchand opened this issue Aug 24, 2023 · 4 comments
Assignees
Labels

Comments

@ManonMarchand
Copy link

Describe the bug

Hi thebe devs and thanks for your software!

Context

We (@bmatthieu3 and I) 're trying to output a jupyter widget (ipyaladin) with thebe-lite.

This widget is written in JS and exports a variable A to window. It works in jupyterlite. See https://cds-astro.github.io/jupyterlite/retro/notebooks/index.html?path=01-intro-to-python-vizier-and-ipyaladin.ipynb

The issue

But with thebe-lite, the widget cannot export A in window and we don't get why. See a live example here :

https://manonmarchand.github.io/draft-thebe-jupyterlite-app/aladin-test

where we get the following issue in the console :

Uncaught (in promise) ReferenceError: A is not defined

And indeed A is not there.
A second run of the cell trying to output the widget gets a different error :

Error: Mismatched anonymous define() module: function(){"use strict";var Zg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Tg(B){return B&&B.__esModule&&Object.prototype.hasOwnProperty.call(B,"default")?B.default:B}var NB={exports:{}};/*!
 * jQuery JavaScript Library v3.6.1
 * https://jquery.com/

​Do you know what's happening?

Thanks a lot, and we hope this is the right place to ask the question.

Reproduce the bug

https://manonmarchand.github.io/draft-thebe-jupyterlite-app/aladin-test

List your environment

The page is generated with the following steps :

jobs:
  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Setup Pages
        uses: actions/configure-pages@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 18.x
      - name: Install MyST Markdown
        run: npm install -g mystmd
      - name: Build HTML Assets
        run: myst build --html
      - name: Upload artifact
        uses: actions/upload-pages-artifact@v1
        with:
          path: './_build/html'
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v2

that can be found in this repo: https://github.com/ManonMarchand/draft-thebe-jupyterlite-app

@welcome
Copy link

welcome bot commented Aug 24, 2023

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@stevejpurves
Copy link
Collaborator

Thanks for reporting @ManonMarchand.

I think this might be the first custom widget we've tried to use with the latest thebe! Just to note that I can reproduce the issue outside of lite using the config thebe: true and running against a local server, which should make debugging a little easier.

@stevejpurves stevejpurves self-assigned this Aug 31, 2023
@ManonMarchand
Copy link
Author

Thanks a lot for looking into it!

By the way our custom widget links this app https://aladin.cds.unistra.fr/AladinLite/planets-explorer/ with the notebooks (in case you wanna take a tour on Mars)

@stevejpurves
Copy link
Collaborator

🙌🏼 it's a very cool widget, I was checking out some nebula whilst trying to debug earlier 😍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants