Oh, I see. It was a problem that depended on the development environment!
I’ve never used Jupyter, but it’s probably a problem specific to Jupyter.
I don’t know how to solve it… I can’t find anything by searching.
gradio-app:main
← gradio-app:3035-blocks-magic-with-interfaces
opened 10:03PM - 03 Feb 23 UTC
# Description
Fixes #3035 by emitting a warning when a cell run with `%%block… s` has an Interface.
Can't think of a way to fix the issue in a backwards compatible way.
I tried skipping the duplicate id check for the magic command but then the demo rendering is messed up (as expected). See below with the code from the reproducer in the original issue:

If you already have a full Interface or blocks app defined, the benefit of the %%blocks magic as opposed to re-running the cell is marginal in my opinion.
What the warning looks like from jupyter

# Checklist:
- [ ] I have performed a self-review of my own code
- [ ] I have added a short summary of my change to the CHANGELOG.md
- [ ] My code follows the style guidelines of this project
- [ ] I have commented my code in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
# A note about the CHANGELOG
Hello 👋 and thank you for contributing to Gradio!
All pull requests must update the change log located in CHANGELOG.md, unless the pull request is labeled with the "no-changelog-update" label.
Please add a brief summary of the change to the Upcoming Release > Full Changelog section of the CHANGELOG.md file and include
a link to the PR (formatted in markdown) and a link to your github profile (if you like). For example, "* Added a cool new feature by `[@myusername](link-to-your-github-profile)` in `[PR 11111](https://github.com/gradio-app/gradio/pull/11111)`".
If you would like to elaborate on your change further, feel free to include a longer explanation in the other sections.
If you would like an image/gif/video showcasing your feature, it may be best to edit the CHANGELOG file using the
GitHub web UI since that lets you upload files directly via drag-and-drop.