cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error While Deploying App | Dynatrace App Developer

zaid-bashir
Advisor

Hello, community members!

I was testing an app, and it worked fine. However, when I attempted to deploy it, the build was successful, but the deployment failed.

Here’s the exact error I encountered:

zaidbashir_0-1739445458389.png

4 REPLIES 4

haris
Dynatrace Advisor
Dynatrace Advisor

Hi Zeid,

Usually, Dynatrace dependencies that use SDK clients, for example: @dynatrace-sdk/react-hooks have a dependency range in place. For example, "@dynatrace-sdk/client-davis-analyzers": ">=1.8.0", which accepts everything above and equal to 1.8.0.
If you update or add a library that contains for example, >=1.8.0 version of a client, it will lead to adding the latest available version of the SDK client if you don't have the SDK client in the required version already in your package.json or package-lock.json. The latest SDK version might be incompatible with the cluster.

How can you resolve the issue

There are some steps you can do:

  1. Check which libraries are using the client
    Simply run npm list @dynatrace-sdk/{your-incompatible-client} and this will show you, where the client is used. Inside the package.json of the library that uses the client, you'll find the dependency range (@dynatrace-sdk/react-hooksexample:

    {
      "name": "@dynatrace-sdk/react-hooks",
      "version": "1.0.0",
      "license": "Apache-2.0",
      "dependencies": {
        "@dynatrace-sdk/client-davis-analyzers": ">=1.8.0",
        "@dynatrace-sdk/client-document": ">=1.20.0",
        "@dynatrace-sdk/client-state": ">=1.7.0",
        "@dynatrace-sdk/client-query": ">=1.17.0",
        "@dynatrace-sdk/app-utils": ">=1.0.0",
        "@dynatrace-sdk/client-app-settings": ">=1.8.0"
      },
      "devDependencies": {
        "react": "^17.0.0",
        "@types/react": "^17.0.80",
        "@testing-library/react": "^12.1.2",
        "@testing-library/react-hooks": "^7.0.2",
        "react-dom": "^17.0.0"
      },
      "peerDependencies": {
        "react": "^17.0.0 || ^18.0.0"
      }
    }

    ).

  2. Check if it's possible to downgrade the client.
    If you have e.g., 1.8.2 installed and the range says >=1.8.0, you could downgrade to 1.8.0

  3. Check which SDK version relates to which service version
    Within the services.json file in the dynatrace-sdk repo, you can see which SDK version relates to which service version. The key in supportedSdkVersions is the service version and the ts array in it tells you which SDK client versions are compatible with it. If your client SDK version relates to a service version that is lower or equal than the deployed service version, you will not run into any problems.
    If you just want to see which service version your current installed SDK client relates to, you can simply go into your node_modules folder and look at the dynatrace-metadata.json of the lib.

     

    image.png

     

  4. Downgrade the client (if possible)
    If you are able to downgrade your SDK client, you can simply call npm i -E @dynatrace-sdk/{your-client} (-E to save the exact version, without ^ beforehand). This will update your package.json and package-lock.json. The lock file is the important one. You don't need to explicitly add the client to your package.json file but it would be a nice to have, to have a quick overview of which client is installed and a sub-depndency could not "easily" bump the client without your notice (you will probably not look in your lock file after updates).

Let me know if that works out for you and if you need any additional help.

Best,

Haris

zaid-bashir
Advisor

Thanks @haris for the input.
But in my case i was using node version 23 and AppToolkit uses Version 22 LTE. When I reverted back to version 22 LTE, the issue automatically fixed.

Screenshot 2025-02-15 163404.PNG

 

Funny solution - with-no-box 😁😁😁😁

 MostafaHussein_0-1739907626646.png

 

Certified Dynatrace Professional | Certified Dynatrace Services - Observability | Certified Dynatrace Services - App Developer
Dynatrace Partner yourcompass.ca

haris
Dynatrace Advisor
Dynatrace Advisor

Hi Zaid, 

I am happy to hear the issue has been resolved. For future reference, you can always check here which Node version is supported for latest toolkit: https://developer.dynatrace.com/quickstart/first-app-in-5-minutes/#:~:text=The%20latest%20Node.js%20...

If you have any more questions, please let me know.

Best, Haris

Featured Posts