Adding the DOM shim also as a server plugin ensures that when the nuxt-ssr-lit module is used, the shim is applied. Otherwise, the shim gets applied ONLY when one of the components is being used in one of the Nuxt pages. This breaks in situations where a component may not be used in any of the pages, but the component definition is still being imported. Then customElement.get won't be available.
Adding the DOM shim also as a server plugin ensures that when the
nuxt-ssr-lit
module is used, the shim is applied. Otherwise, the shim gets applied ONLY when one of the components is being used in one of the Nuxt pages. This breaks in situations where a component may not be used in any of the pages, but the component definition is still being imported. ThencustomElement.get
won't be available.