Skip to content

Jupyter Notebook fails to render for metadata.widgets without "state" key #610

@danicaokamoto

Description

@danicaokamoto

Warning - This is a public repository, please be mindful of sharing sensitive data

Why are you seeing this issue?

This is a support escalation! You can find out more about expectations on communications and response times in the on-call docs. Thank you for doing your part to keep GitHub customers happy!

Severity

Note, for Sev1 issues always page the team first, using the PagerDuty information in the service catalog and the command .pager trigger <rotation> <reason>. Opening an issue for a Sev2 incident can come later (and can be done by the available Escalation Engineer).

  • sev1 - Engineering must respond, when paged, within their on-call SLO
  • sev2 - Engineering must respond to this issue within one business day
  • sev3 - Engineering must respond to this issue within one week

Service

codespaces-jupyter

Context

⚠️ Kindly provide all the requested information to ensure a prompt and efficient response. ⚠️

GitHub Support Plan

  • Top 20
  • Premium Plus
  • Premium
  • Enterprise
  • Free/Pro/Team

GitHub Product(s) Impacted (check appropriate boxes and provide GHES version if applicable)

  • GitHub.com (including GHEC)
  • GitHub Enterprise Server.
    • Running version: x.y.z
    • Recently upgraded from version: x.y.z (upgrade date: yyyy-mm-dd)
  • Proxima (ghe.com)
    • Customer tenant: -

Customer Impact

If applicable, list the impacted entities:

  • Enterprise: -
  • Organization: -
  • Repository: rasbt/LLMs-from-scratch
  • User: d-kleine

Zendesk Ticket(s), support bundles, and other relevant Issues and links

Issue

Here's the details provided by the customer:

When viewing Jupyter Notebooks (.ipynb files) on GitHub, notebooks that contain a metadata.widgets block without a "state" key fail to render in the browser. Instead of displaying the notebook content, GitHub shows an error message indicating that the 'state' key is missing from metadata.widgets. This issue prevents users from viewing or sharing affected notebooks directly on GitHub.

Example:
https://github.com/rasbt/LLMs-from-scratch/blob/00b8c0a107f4cec0012cf8d1f6b54309846d25dd/ch05/11_qwen3/standalone-qwen3.ipynb

GitHub’s notebook renderer seems to enforce stricter validation and refuses to display the notebook if the "state" key is missing. The notebook remains fully functional in local Jupyter environments, where the renderer is more tolerant of incomplete widget metadata.

This issue disrupts the workflow for users who rely on GitHub for sharing, reviewing, or collaborating on Jupyter notebooks online in the browser. This issue has been reported already here:

https://github.com/orgs/community/discussions/155944
https://stackoverflow.com/questions/79661958/jupyter-notebook-rendering-error-state-key-missing-from-metadata-widgets-de
For me, this looks like the "state" key is a strict setting specifically for the GitHub render, that might get lost through export to .ipynb.

To Reproduce

Steps to reproduce the behavior:

  1. Create or obtain a Jupyter notebook (.ipynb) file.
  2. Ensure the notebook’s JSON includes a metadata.widgets block but omits the "state" key (for example, by exporting editing the metadata manually).
  3. Commit and push the notebook to a GitHub repository
  4. View the notebook on GitHub in the browser
  5. Observe that GitHub displays an error stating that the 'state' key is missing from metadata.widgets, and the notebook does not render
  6. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

cc:
@github/codespaces-team
@product_manager

Support Squad(s): @github/support-squad-

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions