Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class 'PathBase' incorrectly implements class 'Dirent' (again) #18

Closed
mrginglymus opened this issue May 8, 2024 · 5 comments
Closed

Comments

@mrginglymus
Copy link
Contributor

mrginglymus commented May 8, 2024

As with #13, except this time it's parentPath, path having been deprecated.

As of @types/node 20.12.11 (DefinitelyTyped/DefinitelyTyped#69490)

@philkunz
Copy link

philkunz commented May 8, 2024

Same problem here.

@philkunz
Copy link

philkunz commented May 8, 2024

Pinning @types/node to 20.10.0 fixes the issue for now.

@cipherdmg
Copy link

I looked yesterday here since I hit this problem a few days ago since I updated my nodejs and types package. I patched the index.d.ts to include the missing getter and it resolved it but I think downgrading nodejs types is cleaner.

Once the update is released I will switch over.

Thanks
CipherDMG

@leahecole
Copy link

leahecole commented May 9, 2024

It looks like the 1.10.4 release from a little while ago fixed this for me 🥳 , thanks folks!

@cipherdmg
Copy link

Thanks for patching the release. This is now fixed for me.

@isaacs isaacs closed this as completed May 10, 2024
36degrees added a commit to alphagov/govuk-frontend that referenced this issue May 28, 2024
Fixes a type issue introduced in `@types/node 20.12.11` [1]:

```
node_modules/path-scurry/dist/cjs/index.d.ts:117:31 - error TS2720: Class 'PathBase' incorrectly implements class 'Dirent'. Did you mean to extend 'Dirent' and inherit its members as a subclass?
  Property 'parentPath' is missing in type 'PathBase' but required in type 'Dirent'.

117 export declare abstract class PathBase implements Dirent {
                                  ~~~~~~~~

  node_modules/@types/node/fs.d.ts:247:9
    247         parentPath: string;
                ~~~~~~~~~~
    'parentPath' is declared here.
```

Bump glob, which includes path-scurry as a dependency:

```
$ npm ls path-scurry
@govuk-frontend/repository@ /Users/oliver.byford/Code/govuk-frontend
└─┬ @govuk-frontend/lib@ -> ./shared/lib
  └─┬ glob@10.3.10
    └── path-scurry@1.10.1
```

[1]: isaacs/path-scurry#18
romaricpascal pushed a commit to alphagov/govuk-frontend that referenced this issue May 30, 2024
Fixes a type issue introduced in `@types/node 20.12.11` [1]:

```
node_modules/path-scurry/dist/cjs/index.d.ts:117:31 - error TS2720: Class 'PathBase' incorrectly implements class 'Dirent'. Did you mean to extend 'Dirent' and inherit its members as a subclass?
  Property 'parentPath' is missing in type 'PathBase' but required in type 'Dirent'.

117 export declare abstract class PathBase implements Dirent {
                                  ~~~~~~~~

  node_modules/@types/node/fs.d.ts:247:9
    247         parentPath: string;
                ~~~~~~~~~~
    'parentPath' is declared here.
```

Bump glob, which includes path-scurry as a dependency:

```
$ npm ls path-scurry
@govuk-frontend/repository@ /Users/oliver.byford/Code/govuk-frontend
└─┬ @govuk-frontend/lib@ -> ./shared/lib
  └─┬ glob@10.3.10
    └── path-scurry@1.10.1
```

[1]: isaacs/path-scurry#18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants