Skip to content

Commit 0fffb14

Browse files
authored
Merge pull request #2027 from plotly/err-message
provide simple example of the error
2 parents c61cb7a + 00dd467 commit 0fffb14

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
2828

2929
- [#1751](https://github.com/plotly/dash/pull/1751) Rename `app.run_server` to `app.run` while preserving `app.run_server` for backwards compatibility.
3030

31+
- [#2027](https://github.com/plotly/dash/pull/1751) Improve the error message when a user doesn't wrap children in a list
3132

3233
### Updated
3334
- [#2016](https://github.com/plotly/dash/pull/2016) Widespread dependency upgrades

dash/development/base_component.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,9 @@ def __init__(self, **kwargs):
136136
raise TypeError(
137137
error_string_prefix
138138
+ " detected a Component for a prop other than `children`\n"
139+
+ f"Prop {k} has value {v!r}\n\n"
139140
+ "Did you forget to wrap multiple `children` in an array?\n"
140-
+ f"Prop {k} has value {v!r}\n"
141+
+ "For example, it must be html.Div([\"a\", \"b\", \"c\"]) not html.Div(\"a\", \"b\", \"c\")\n"
141142
)
142143

143144
if k == "id":

0 commit comments

Comments
 (0)