<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using 3rdparty modules in js runtime. in Developer Q&amp;A Forum</title>
    <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Using-3rdparty-modules-in-js-runtime/m-p/234763#M767</link>
    <description>&lt;P&gt;Yes, as of now that would be the workaround.&lt;/P&gt;
&lt;P&gt;There have been plans to add 3rd packages support for functions in workflows and notebooks but I don't have any further details on that.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jan 2024 14:00:47 GMT</pubDate>
    <dc:creator>sinisa_zubic</dc:creator>
    <dc:date>2024-01-18T14:00:47Z</dc:date>
    <item>
      <title>Using 3rdparty modules in js runtime.</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Using-3rdparty-modules-in-js-runtime/m-p/234667#M763</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello development team! &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The last time I read about JS runtime limitations, I remember the ability to import third-party modules for use in applications and/or workflow tasks. Reading again, &lt;A href="https://developer.dynatrace.com/reference/javascript-runtime/" target="_blank" rel="noopener"&gt;https://developer.dynatrace.com/reference/javascript-runtime/&lt;/A&gt; seems like there is much more limited support for importing third party modules.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My use case is to use cheerio to extract information from a scrap via fetch and send the value to a metric. Is something like that not possible? Since the moment that I call the cheerio function I get the following error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;&lt;STRONG&gt;An error occurred: {"code": 541, "message": "Execution crashed.", "details": {"type": "BAD_REQUEST", "message": "&amp;lt;stripped secret anyhow::Error&amp;gt;"}}&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 20:52:05 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Using-3rdparty-modules-in-js-runtime/m-p/234667#M763</guid>
      <dc:creator>DantePaoloni</dc:creator>
      <dc:date>2024-01-17T20:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using 3rdparty modules in js runtime.</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Using-3rdparty-modules-in-js-runtime/m-p/234752#M764</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/70651"&gt;@DantePaoloni&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes the JS runtime has some limitations when it comes to 3rd party modules.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried to reproduce your problem. loading data via fetch and using cheerio to extract it. This is my code snippet, it works without any problems&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;import * as cheerio from "cheerio";

export default async function (payload: unknown = undefined) {
  const resp = await fetch("https://example.com/");
  const txt = await resp.text();
  const $ = cheerio.load(txt);
  console.log($("title").text());
  return $("h1").text();
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe you can share your AppFunction code with us?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;BR /&gt;Sini&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2024 13:10:31 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Using-3rdparty-modules-in-js-runtime/m-p/234752#M764</guid>
      <dc:creator>sinisa_zubic</dc:creator>
      <dc:date>2024-01-18T13:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using 3rdparty modules in js runtime.</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Using-3rdparty-modules-in-js-runtime/m-p/234756#M765</link>
      <description>&lt;P&gt;If I'm interpreting the error&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/70651"&gt;@DantePaoloni&lt;/a&gt;&amp;nbsp; shared correctly, he might be using the "Run Javascript" action in Workflows, which currently doesn't support 3rd party libraries.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2024 13:33:05 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Using-3rdparty-modules-in-js-runtime/m-p/234756#M765</guid>
      <dc:creator>michal_zawislak</dc:creator>
      <dc:date>2024-01-18T13:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using 3rdparty modules in js runtime.</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Using-3rdparty-modules-in-js-runtime/m-p/234760#M766</link>
      <description>&lt;P&gt;Hey, I was re checking again just in case. Indeed is a JS Action in a workflow.&lt;/P&gt;&lt;P&gt;Will eventually be supported? Or this is be something to create in&amp;nbsp; an AppFunction and call it throught a workflow like in&amp;nbsp;&lt;A href="https://developer.dynatrace.com/develop/functions/create-function/#from-notebooks-or-workflows" target="_blank" rel="noopener"&gt;https://developer.dynatrace.com/develop/functions/create-function/#from-notebooks-or-workflows&lt;/A&gt;&amp;nbsp;? Im asking in this case the "right" way to handle it.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2024 13:58:43 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Using-3rdparty-modules-in-js-runtime/m-p/234760#M766</guid>
      <dc:creator>DantePaoloni</dc:creator>
      <dc:date>2024-01-18T13:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using 3rdparty modules in js runtime.</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Using-3rdparty-modules-in-js-runtime/m-p/234763#M767</link>
      <description>&lt;P&gt;Yes, as of now that would be the workaround.&lt;/P&gt;
&lt;P&gt;There have been plans to add 3rd packages support for functions in workflows and notebooks but I don't have any further details on that.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2024 14:00:47 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Using-3rdparty-modules-in-js-runtime/m-p/234763#M767</guid>
      <dc:creator>sinisa_zubic</dc:creator>
      <dc:date>2024-01-18T14:00:47Z</dc:date>
    </item>
  </channel>
</rss>

