Skip to content
S

server-dom-shim

A simple shim for the server-side DOM API

by ocavueFree

#649in UI Libraries
0In stores

Description

server-dom-shim is a small package that stops server-side rendering from failing on browser-only DOM classes. When code that refers to HTMLE…

Highlights

  • Stops HTMLElement is not defined errors on the server
  • Conditional exports for Node.js and browsers
  • Server side uses @lit-labs/ssr-dom-shim
  • Browsers get the native DOM API
  • MIT licensed

Ratings & Reviews

No ratings yet

Be the first to rate server-dom-shim.

People also visit

W

@webcomponents/shadydom

Web Components Polyfills

UI Libraries
Launch
L

@lwc/synthetic-shadow

Shadow DOM polyfill by LWC

UI Libraries
Launch
H

Happy Dom

A JavaScript implementation of a web browser without its graphical user

Developer Tools
Launch
E

expo/use-dom

Run web code in a webview on native using DOM components

AI Skills
Get
D

dom-helpers

tiny modular DOM lib for ie9+

UI Libraries
Launch
H

html2canvas

Take screenshots of any part of your web page using Javascript

UI Libraries
Launch

server-dom-shim FAQ

What problem does it solve?

Server-side rendering fails with an HTMLElement is not defined error when DOM classes are used on Node.js. This package provides stand-ins on the server.

Is it free?

Yes. It is released under the MIT license.

Does it change the code in the browser?

No. In a browser the package exports the native DOM API, so browser behaviour is unchanged.

What does it use on the server?

In Node.js it exports the DOM API from the @lit-labs/ssr-dom-shim package.

What are the best server-dom-shim alternatives?

Popular alternatives to server-dom-shim include @webcomponents/shadydom, @lwc/synthetic-shadow and dom-helpers. See all server-dom-shim alternatives

Developer Stuff

Badges