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

When running a prod build, getting: Uncaught DOMException: Failed to execute 'createElement' on 'Document': The tag name provided ('[object Object]') is not a valid name. #488

Closed maxnachlinger closed 6 years ago

maxnachlinger commented 6 years ago

First - preact and preact-compat are both awesome - my users really appreciate the smaller bundle sizes and the API enhancements preact brings are great! I also realise this very exception has been addressed here .

Unfortunately, I'm only seeing the above exception in a production build, which kinda exempts me from using preact/debug :) At any rate, my issue stems from using preact with preact-compat and react-day-picker. I've created a simple completely-non-fancy repo here https://github.com/maxnachlinger/daypicker-preact-issue to reproduce this issue.

In dev mode, everything is dazzling, but when I build for production I get a curious:

Uncaught DOMException: Failed to execute 'createElement' on 'Document': The tag name provided ('[object Object]') is not a valid name. at HTMLDocument.createElement (:1:1554)

error.

jessicabyrne commented 6 years ago

We're seeing this as well, it works in dev mode but in production preact isn't playing nicely with the datepicker (our preferred datepicker because of its smaller bundle size!)

maxnachlinger commented 6 years ago

Looks like the research in https://github.com/developit/preact-compat/issues/484 fixed my issue as well :)