Skip to content

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

Notifications You must be signed in to change notification settings

lfre/preact-render-to-string-issue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>
}

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published