apache / apache/cordova-plugin-file

error TS2687: All declarations of 'name' must have identical modifiers.

Open
#592 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
744
Forks
754
Avg merge
3d 4h
Merged PRs (30d)
1

Description

# Bug Report

## Problem

### What is expected to happen?
successful build

### What does actually happen?
```
Error: node_modules/cordova-plugin-file/types/index.d.ts:47:5 - error TS2687: All declarations of 'name' must have identical modifiers.

47 name: string;
~~~~

Error: node_modules/cordova-plugin-file/types/index.d.ts:49:5 - error TS2687: All declarations of 'root' must have identical modifiers.

49 root: DirectoryEntry;
~~~~

Error: node_modules/cordova-plugin-file/types/index.d.ts:49:5 - error TS2717: Subsequent property declarations must have the same type. Property 'root' must be of type 'FileSystemDirectoryEntry', but here has type 'DirectoryEntry'.

49 root: DirectoryEntry;
~~~~

node_modules/typescript/lib/lib.dom.d.ts:8316:14
8316 readonly root: FileSystemDirectoryEntry;
~~~~
'root' was also declared here.

Error: node_modules/typescript/lib/lib.dom.d.ts:8314:14 - error TS2687: All declarations of 'name' must have identical modifiers.

8314 readonly name: string;
~~~~

Error: node_modules/typescript/lib/lib.dom.d.ts:8316:14 - error TS2687: All declarations of 'root' must have identical modifiers.

8316 readonly root: FileSystemDirectoryEntry;

```

## Information

### Command or Code

npm run build in Ionic 7

### Environment, Platform, Device

Windows 11

### Version information

"typescript": "~5.1.6"
"cordova-plugin-file": "^8.0.0",

## Checklist

- [x] I searched for existing GitHub issues
- [ ] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above

Contributor guide

Open the contributing guide

Research direction

Compare node_modules/cordova-plugin-file/types/index.d.ts with node_modules/typescript/lib/lib.dom.d.ts, focusing on the conflicting name and root declarations. Reproduce the failure with npm run build in the reported Ionic 7 setup; done means the TypeScript build completes successfully without TS2687 or TS2717 errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.