UI5 / UI5/typescript

tsc gives 'Duplicate identifier' error messages (@openui5/ts-types@1.90.5)

Open
#289 12 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

legacy ts-types (with globals)
Dominant language
TypeScript
Stars
213
Forks
35
Avg merge
37m
Merged PRs (30d)
1

Description

When running tsc on an empty JavaScript file it gives the following error messages:

$ ./node_modules/typescript/bin/tsc
node_modules/@openui5/ts-types/types/sap.m.d.ts:301:15 - error TS2300: Duplicate identifier 'MessageBox'.

301     namespace MessageBox {
                  ~~~~~~~~~~

node_modules/@openui5/ts-types/types/sap.m.d.ts:24179:15 - error TS2300: Duplicate identifier 'MessageBox'.

24179     interface MessageBox {
                    ~~~~~~~~~~

node_modules/@openui5/ts-types/types/sap.m.d.ts:24868:11 - error TS2300: Duplicate identifier 'MessageBox'.

24868     const MessageBox: MessageBox;
                ~~~~~~~~~~

node_modules/@openui5/ts-types/types/sap.ui.commons.d.ts:3401:17 - error TS2300: Duplicate identifier 'MessageBox'.

3401       namespace MessageBox {
                     ~~~~~~~~~~

node_modules/@openui5/ts-types/types/sap.ui.commons.d.ts:6401:17 - error TS2300: Duplicate identifier 'MessageBox'.

6401       interface MessageBox {
                     ~~~~~~~~~~

node_modules/@openui5/ts-types/types/sap.ui.commons.d.ts:6526:13 - error TS2300: Duplicate identifier 'MessageBox'.

6526       const MessageBox: MessageBox;
                 ~~~~~~~~~~

node_modules/@openui5/ts-types/types/sap.ui.core.d.ts:37617:19 - error TS2300: Duplicate identifier 'odata4analytics'.

37617         namespace odata4analytics {
                        ~~~~~~~~~~~~~~~

node_modules/@openui5/ts-types/types/sap.ui.core.d.ts:39118:19 - error TS2300: Duplicate identifier 'odata4analytics'.

39118         interface odata4analytics {
                        ~~~~~~~~~~~~~~~

node_modules/@openui5/ts-types/types/sap.ui.core.d.ts:39133:15 - error TS2300: Duplicate identifier 'odata4analytics'.

39133         const odata4analytics: odata4analytics;
                    ~~~~~~~~~~~~~~~

node_modules/@openui5/ts-types/types/sap.ui.core.d.ts:58425:15 - error TS2300: Duplicate identifier 'Device'.

58425     namespace Device {
                    ~~~~~~

node_modules/@openui5/ts-types/types/sap.ui.core.d.ts:59682:19 - error TS2300: Duplicate identifier 'dataTableUtils'.

59682         namespace dataTableUtils {
                        ~~~~~~~~~~~~~~

node_modules/@openui5/ts-types/types/sap.ui.core.d.ts:59750:19 - error TS2300: Duplicate identifier 'dataTableUtils'.

59750         interface dataTableUtils {
                        ~~~~~~~~~~~~~~

node_modules/@openui5/ts-types/types/sap.ui.core.d.ts:59826:15 - error TS2300: Duplicate identifier 'dataTableUtils'.

59826         const dataTableUtils: dataTableUtils;
                    ~~~~~~~~~~~~~~

node_modules/@openui5/ts-types/types/sap.ui.core.d.ts:63827:15 - error TS2300: Duplicate identifier 'Device'.

63827     interface Device {}
                    ~~~~~~

node_modules/@openui5/ts-types/types/sap.ui.core.d.ts:63828:11 - error TS2300: Duplicate identifier 'Device'.

63828     const Device: Device;
                ~~~~~~


Found 15 errors.

$ cat tsconfig.json
{
	"compilerOptions": {
		"incremental": true,
		"noImplicitAny": false,
		"noImplicitReturns": true,
		"noImplicitThis": true,
		"strictBindCallApply": true,
		"strictFunctionTypes": true,
		"strictPropertyInitialization": false,
		"strictNullChecks": false,
		"allowJs": true,
		"checkJs": true,
		"module": "ESNext",
		"target": "ES2020",
		"types": ["@openui5/ts-types", "@types/qunit", "@types/jquery"],
		"noEmit": true,
		"noFallthroughCasesInSwitch": true, 
		"allowUnreachableCode": false,
		"allowUnusedLabels": false,
		"lib": ["dom","es7"]
	},
	"include": [
		"./empty.js"
	]
}
$ npm list
my_fiori@1.0.0 /Users/myuser/Documents/my_fiori
├── @openui5/ts-types@1.90.5
├─┬ @types/jquery@3.5.6
│ └── @types/sizzle@2.3.3
├── @types/qunit@2.11.2
└── typescript@4.3.5


Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with the shown tsconfig.json, empty.js, TypeScript 4.3.5, and @openui5/ts-types@1.90.5. Inspect the duplicate declarations in types/sap.m.d.ts, types/sap.ui.commons.d.ts, and types/sap.ui.core.d.ts, then compare how the configured type libraries are loaded. Done means the minimal tsc run no longer reports these duplicate identifier errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.