[WIP] Invalid Notebook There was an error rendering your Notebook: the 'state' key is missing from 'metadata.widgets'. Add 'state' to each, or remove 'metadata.widgets'. Using nbformat v5.10.4 and nbconvert v7.16.6 #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
utils/generate_notebooks.pybuild_notebook()function to include proper widget metadata structurecourse/ko/chapter1/section3.ipynbProblem Fixed:
The issue was that notebook metadata was missing the required
metadata.widgets["application/vnd.jupyter.widget-state+json"]["state"]structure that nbconvert expects. This caused nbconvert to fail with a KeyError when trying to render notebooks.Changes Made:
utils/generate_notebooks.py: Added proper widget metadata structure with emptystateobject to all generated notebookscourse/ko/chapter1/section3.ipynb: Fixed existing notebook by wrapping widget entries under the requiredstatekeyValidation:
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.