ionic-team / stencil

A toolchain for building scalable, enterprise-ready component systems on top of TypeScript and Web Component standards. Stencil components can be distributed natively to React, Angular, Vue, and traditional web developers from a single, framework-agnostic codebase.
https://stenciljs.com
Other
12.41k stars 777 forks source link

bug: Uncaught TypeError: this.__attachShadow is not a function #3161

Closed wbern closed 2 years ago

wbern commented 2 years ago

Prerequisites

Stencil Version

2.10.0

Current Behavior

When I load in stenciljs components as a Vue app consumer, the component fails to load.

index.js:2100 Uncaught TypeError: this.__attachShadow is not a function
    at new NotificationComponent$1 (index.js:2100)
    at Object.createElement$1 [as createElement] (vue.runtime.esm.js:5685)
    at createElm (vue.runtime.esm.js:5949)
    at createChildren (vue.runtime.esm.js:6053)
    at createElm (vue.runtime.esm.js:5954)
    at VueComponent.patch [as __patch__] (vue.runtime.esm.js:6477)
    at VueComponent.Vue._update (vue.runtime.esm.js:3945)
    at VueComponent.updateComponent (vue.runtime.esm.js:4066)
    at Watcher.get (vue.runtime.esm.js:4479)
    at new Watcher (vue.runtime.esm.js:4468)

this __attachShadow does not exist on the HTMLElement instance.

Expected Behavior

I should be able to load custom-elements output type like this without polyfills enabled.

Steps to Reproduce

I'm not completely sure how to reproduce this, and I'm curious if this is a known issue.

Code Reproduction URL

n/a

Additional Information

No response

rwaskiewicz commented 2 years ago

@wbern this is likely due to having one of two things in your project:

This is due to a change in the way an internal API was exposed for certain build types, which was fixed in v2.10.0. Based on the output you included, I would guess that it's the latter. Would it be possible to upload a link to the project?

wbern commented 2 years ago

@rwaskiewicz you're right that I had an old version of stencil in one of my packages. I bumped that and now it works, thanks!