preactjs / preact-compat

ATTENTION: The React compatibility layer for Preact has moved to the main preact repo.
http://npm.im/preact-compat
MIT License
949 stars 148 forks source link

Error: DOMException: Failed to execute 'createElement' on 'Document': The tag name provided ('[object Object]') is not a valid name #451

Closed stereobooster closed 6 years ago

stereobooster commented 6 years ago

I tried to switch to preact-compat https://github.com/stereobooster/an-almost-static-stack/pull/4, but it fails with this error

 Error: DOMException: Failed to execute 'createElement' on 'Document': The tag name provided ('[object Object]') is not a valid name.
    at createElement (../node_modules/preact/dist/preact.esm.js:183:0)
    at createNode (../node_modules/preact/dist/preact.esm.js:364:0)
    at idiff (../node_modules/preact/dist/preact.esm.js:306:0)
    at diff (../node_modules/preact/dist/preact.esm.js:949:0)
    at vnode (../node_modules/preact-compat/dist/preact-compat.es.js:149:0)
    at __WEBPACK_IMPORTED_MODULE_0_react__ (index.js:30:7)
    at call (../webpack/bootstrap 3d46b713f8f74ea5ecff:49:0)
    at __webpack_require__ (../static/js/main.6fe07f11.js:3020:17)
    at call (../webpack/bootstrap 3d46b713f8f74ea5ecff:49:0)
    at http://localhost:45678/static/js/main.6fe07f11.js:1:1387

any recommendations for debugging this?

Thank you for your project.

PS.

developit commented 6 years ago

Hi there - this happens when you reference a function as a component, but it's actually an object (eg: null). Are you using Fragments at all?

If you install preact/debug you will find it warns you and tells you where the issue arose.

stereobooster commented 6 years ago

The strange part, that I was able to replace React with preact-compat in another branch (it is kind of solved my original issue). I do not have time right now to look into this issue. I will close the ticket and report back if I have updates. Thank you for the help.