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

Error: Objects are not valid as a React child #96

Closed
mauritsvanrees opened this issue May 7, 2024 · 2 comments · Fixed by #97
Closed

Error: Objects are not valid as a React child #96

mauritsvanrees opened this issue May 7, 2024 · 2 comments · Fixed by #97

Comments

@mauritsvanrees
Copy link
Member

I have a Plone 6.0 site with Volto 18, volto-light-theme, and collective.volto.formsupport (tried 2.7.0 and 3.0.2). volto-form-block 3.7.3 works fine. But when using latest volto-form-block 3.8.2 (or 3.7.4 or 3.7.5) I get this error when submitting a form:

    Objects are not valid as a React child (found: object with keys {message}). If you meant to render a collection of children, use an array instead.
    
    p
    div
    Message@http://localhost:3001/static/js/client.js:317567:29
    FormResult@http://localhost:3001/static/js/VoltoFormBlockView.chunk.js:700:20
    InnerLoadable@http://localhost:3001/static/js/client.js:2179:34
    div
    Segment@http://localhost:3001/static/js/client.js:321861:18
    div
    div
    FormView@http://localhost:3001/static/js/VoltoFormBlockView.chunk.js:825:18
    ValidateConfigForm@http://localhost:3001/static/js/VoltoFormBlockView.chunk.js:1172:28
    View@http://localhost:3001/static/js/VoltoFormBlockView.chunk.js:1358:14
    InnerLoadable@http://localhost:3001/static/js/client.js:2179:34
    StyleWrapper@http://localhost:3001/static/js/client.js:90646:7
    MaybeWrap@http://localhost:3001/static/js/client.js:130418:9
    div
    MaybeWrap@http://localhost:3001/static/js/client.js:130418:9
    RenderBlocks@http://localhost:3001/static/js/client.js:67113:7
    div
    $2e5fe81f2b094176$export$42a852a2b6b56249@http://localhost:3001/static/js/client.js:364550:122
    DefaultView@http://localhost:3001/static/js/client.js:156415:7
    injectIntl(DefaultView)
    div
    View@http://localhost:3001/static/js/client.js:157707:5
    ConnectFunction@http://localhost:3001/static/js/client.js:242834:103
    injectIntl(Connect(View))
    Route@http://localhost:3001/static/js/client.js:247979:29
    Switch@http://localhost:3001/static/js/client.js:248185:29
    main
    div
    Segment@http://localhost:3001/static/js/client.js:321861:18
    MultilingualRedirector@http://localhost:3001/static/js/client.js:152642:7
    PluggablesProvider@http://localhost:3001/static/js/client.js:131757:28
    App@http://localhost:3001/static/js/client.js:149041:5
    ConnectFunction@http://localhost:3001/static/js/client.js:242834:103
    injectIntl(Connect(App))
    ConnectFunction@http://localhost:3001/static/js/client.js:242834:103
    Route@http://localhost:3001/static/js/client.js:247979:29
    Switch@http://localhost:3001/static/js/client.js:248185:29
    Route@http://localhost:3001/static/js/client.js:247979:29
    AsyncConnect@http://localhost:3001/static/js/client.js:162047:5
    AsyncConnectWithContext@http://localhost:3001/static/js/client.js:162166:9
    C@http://localhost:3001/static/js/client.js:248240:31
    ConnectFunction@http://localhost:3001/static/js/client.js:242834:103
    ScrollToTop@http://localhost:3001/static/js/client.js:167133:1
    ConnectFunction@http://localhost:3001/static/js/client.js:242834:103
    Router@http://localhost:3001/static/js/client.js:247608:30
    ConnectedRouter@http://localhost:3001/static/js/client.js:16501:22
    ConnectedRouterWithContext@http://localhost:3001/static/js/client.js:16607:19
    ConnectFunction@http://localhost:3001/static/js/client.js:242834:103
    IntlProvider@http://localhost:3001/static/js/client.js:239501:9
    ConnectFunction@http://localhost:3001/static/js/client.js:242834:103
    Provider@http://localhost:3001/static/js/client.js:242542:18
    CookiesProvider@http://localhost:3001/static/js/client.js:191616:28

Since this error first appears for me in 3.7.4, it should be related to PR #94 by @giuliaghisini . Any idea?

@giuliaghisini
Copy link
Contributor

i think it's not relateed to that pr.
We are using latest versions of volto-form-block and collective.volto.formSupport with some customizations but not on that specific part where error comes up.

Could you make some debug end eventually make a pr ?

@mauritsvanrees
Copy link
Member Author

I have a PR with a fix.

Just for the record: I had the problem on Volto 18 with volto-light-theme, but I tried in a fresh Volto 17 project and this had the same problem that the form could not be submitted.

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

Successfully merging a pull request may close this issue.

2 participants