Incompatible with NextJs
abdolian opened this issue · comments
Have you tried this?
https://github.com/WebReflection/uhtml-ssr
You mean ... uhtml-ssr 🤔
SSR is different, try this on a NextJs App:
import type { NextPage } from 'next';
import { render } from 'uhtml';
const Home: NextPage = () => {
console.log(render)
return null
};
export default Home;
You'll receive an error that is related to DOM
@abdolian uhtml uses the DOM to create templates and elements, I've no idea how you expect it to work without a document
in it so ... if it's SSR you are after, there is uhtml-ssr.
If NextJs has a document
hidden behind a fake global self
or window
then I might pass through that, although this is not a bug of this library, this is how the DOM works.