Pricing Blog

Can packages be used in exported web components?

  • chrislaupama-1313707601975971960

    Chris Laupama

    6 months ago

    I keep getting errors in my exported web-component that it couldn't find package components?

    I'm using @Andreas Møller markdown block within a web-component and it's just not working.
    1313707602361978880-Screenshot_2024-12-04_at_4.24.34_PM.png
  • max.kayr-1313716954309070899

    Max

    6 months ago

    Yes, you can use them in exported components. The error is not about the package. The custom action could not find the element with the ID "markdown..."
    Looks like Andreas needs to adjust the code a little 😁
  • The document object is not available in exported components
  • Due to the Shadow DOM, I think
  • andreasmoller-1313733493976596510

    Andreas Møller

    6 months ago

    Ah 👍
  • chrislaupama-1314135562709504020

    Chris Laupama

    6 months ago

    Do you think this will be fixed for hackathon entries @Andreas Møller ? - otherwise I'll make some changes at my end for standard text.
  • jacobkofoed-1314154665545306153

    Jacob Kofoed

    6 months ago

    FYI: In custom-actions, you can use the ctx.root instead of document to get the nearest document object. If the component is running in ShadowDOM, it will return the shadow root, otherwise it will return the document as normally.
  • andreasmoller-1314160004999413790

    Andreas Møller

    6 months ago

    IT should be fixed now 🙂
    🔥1
  • Thanks !
    🙌🏽1