Skip to content

Error creating Singleton instance of sap.ushell.Container in SAPUI5 1.120.12 with TypeScript #465

Open
@Kasde96

Description

@Kasde96

Hello Experts,

I am encountering an issue with SAPUI5 version 1.120.12 when trying to create a Singleton instance of sap.ushell.Container to get a Navigation Service for navigating to another SAPUI5 application using a semantic object and action.

Problem

The intended method call, as per the API documentation, should be:

sap.ushell.Container.getServiceAsync("Navigation")

However, the linter reports an error, and even the API documentation's recommended approach does not work in TypeScript.

Code Snippet:

sap.ushell.Container.getServiceAsync("Navigation").then(function (navigation) {
    navigation.toExternal({
        target: {
            semanticObject: "SemanticObject",
            action: "action"
        }
    });
});

Linter Error

image

Additional Information

The issue might be related to an incorrect type definition file, as the method call provided in the API documentation also fails in TypeScript.

How should this method be correctly invoked in TypeScript to avoid the linting error? Could the type definition file for this version be incorrect?

Thank you for your assistance.

Best regards,

Dominik Kastenmeier

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions