webpack-extension-reloader icon indicating copy to clipboard operation
webpack-extension-reloader copied to clipboard

Getting TypeScript errors in the type definitions file

Open vladfulgeanu opened this issue 4 years ago • 2 comments

Type:

  • [X] bug
  • [ ] feature
  • [ ] enhancement
  • [X] question

Environment:

  • OS: Ubuntu 20.04
  • Browser: Chrome 81
  • Library Version: 1.1.4

I'm going to open a PR:

  • [ ] yes
  • [X] no

Description:

Started getting these 3 new TypeScript errors when starting webpack:

[at-loader] ./node_modules/webpack-extension-reloader/typings/webpack-extension-reloader.d.ts:7:13 
    TS2304: Cannot find name 'IEntriesOption'. 

[at-loader] ./node_modules/webpack-extension-reloader/typings/webpack-extension-reloader.d.ts:19:3 
    TS2666: Exports and export assignments are not permitted in module augmentations. 

[at-loader] ./node_modules/webpack-extension-reloader/typings/webpack-extension-reloader.d.ts:20:3 
    TS2666: Exports and export assignments are not permitted in module augmentations. 

When going inside that file I can indeed see the TS errors: image

What would be the cause for this?

vladfulgeanu avatar May 20 '20 15:05 vladfulgeanu

I'm not getting these exact errors but if I use typescript style import than TSC says the following: This expression is not constructable. Type 'typeof IExtensionReloaderInstance' has no construct signatures.

Are the type definitions perhaps out of date?

rikharink avatar Jun 08 '20 19:06 rikharink

I noticed the problem doesn't happen whenallowJS is disabled in tsconfig.json. Also, it wasn't happening with allowJS enabled and typescript 3.8.3.

nopmop avatar May 26 '21 14:05 nopmop