-
Notifications
You must be signed in to change notification settings - Fork 795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: instance is undefined when consuming dist-custom-elements bundle #5596
Comments
This is a duplicate of #5457 We will be starting working on a bugfix this week and will provide an update soon. |
that's great news, thank you. |
@bitflower sorry for the delayed response. I was finally able to get to the bottom of this. In your example you are importing a Stencil component that was generated through the in my-component-lib/stencil.config.ts diff --git a/my-component-lib/stencil.config.ts b/my-component-lib/stencil.config.ts
index c709469..b416c3b 100644
--- a/my-component-lib/stencil.config.ts
+++ b/my-component-lib/stencil.config.ts
@@ -8,6 +8,7 @@ export const config: Config = {
type: 'dist-custom-elements',
customElementsExportBehavior: 'bundle',
isPrimaryPackageOutputTarget: true,
+ externalRuntime: false,
},
],
testing: { This will ensure that the component uses the correct Stencil runtime and is not importing the runtime for lazy loaded components which it doesn't support. We will work to ensure that we have mechanism in place to avoid this from happening or at least throw a more meaningful error. Let me know if you have any further questions. |
Hi @christian-bromann ! Thanks for your feedback ! I'll jump into this and try your proposal. Will post back here with my findings. |
Prerequisites
Stencil Version
4.13.0
Current Behavior
We get this error:
See the readme.md in the repro project.
This is pre-discussed with @rwaskiewicz on Discord
Expected Behavior
The consumed Stencil package works without errors.
System Info
Steps to Reproduce
Steps
Setup my-component-lib
cd my-componentlib
npm i
npm run build
npm link
Setup consumer-app
cd consumer-app
npm i
npm link my-componentlib
npm start
Now open your browser and check the console
Code Reproduction URL
https://github.com/bitflower/stencil-instance-issue
Additional Information
No response
The text was updated successfully, but these errors were encountered: