Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 985 Bytes

README.md

File metadata and controls

25 lines (17 loc) · 985 Bytes

preact-render-to-string-issue

Next.js Preact issue in development with preact-render-to-string 5.2.4+ and false esmExternals experiment.

Versions

  • Next.js 12.3.1
  • Next Plugin Preact 3.0.7
  • Preact render to string 5.2.5 (5.2.4 has the same issue)

Issue

When using next-plugin-preact and preact-render-to-string 5.2.4+ in development mode and esmExternals: false experiment to solve this issue, the following error is thrown:

Error: Objects are not valid as a child. Encountered an object with the keys {0,1,2,3,4,5,6,7,8,9,10}.

The cause of the issue is triggered by the preact/debug entry. Reference, and the usage of variable interpolation in components. Example:

function MyComponent({ name }) {
    return <div>My {name}</div>
}