asivery / webminidisc

Upload your Music to NetMD and HiMD MiniDisc devices thanks to WebUSB and WASM
GNU General Public License v2.0
122 stars 28 forks source link

Fails to build on Node v22.9.0 #60

Closed r1cebank closed 2 months ago

r1cebank commented 2 months ago

Hi,

When pulled down this repository master, I am having issues to build the project when running npm run build, here is the error in the output. The project seems to be building fine for older commits: 68e4d9e50160de127064879713f89cb420f6b15e

Thanks

src/services/interface-service-manager.ts:90:9 - error TS2322: Type '(parameters: CustomParameters | undefined) => NetMDMockService' is not assignable to type '(parameters?: CustomParameters | undefined) => NetMDService | null'.
  Call signature return types 'NetMDMockService' and 'NetMDService | null' are incompatible.
    The types returned by 'factory()' are incompatible between these types.
      Type 'Promise<NetMDFactoryMockService>' is not assignable to type 'Promise<NetMDFactoryService | null>'.

90         create: (parameters) => {
           ~~~~~~

  src/services/interface-service-manager.ts:9:5
    9     create: (parameters?: CustomParameters) => NetMDService | null;
          ~~~~~~
    The expected type comes from property 'create' which is declared here on type 'ServicePrototype'

src/services/interfaces/netmd-mock.ts:447:11 - error TS2416: Property 'factory' in type 'NetMDMockService' is not assignable to the same property in base type 'NetMDService'.
  Type '() => Promise<NetMDFactoryMockService>' is not assignable to type '() => Promise<NetMDFactoryService | null>'.
    Type 'Promise<NetMDFactoryMockService>' is not assignable to type 'Promise<NetMDFactoryService | null>'.
      Property 'setDiscSwapDetection' is missing in type 'NetMDFactoryMockService' but required in type 'NetMDFactoryService'.

447     async factory() {
              ~~~~~~~

  src/services/interfaces/netmd.ts:299:5
    299     setDiscSwapDetection(enable: boolean): Promise<void>;
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    'setDiscSwapDetection' is declared here.

src/services/interfaces/netmd-mock.ts:461:7 - error TS2420: Class 'NetMDFactoryMockService' incorrectly implements interface 'NetMDFactoryService'.
  Property 'setDiscSwapDetection' is missing in type 'NetMDFactoryMockService' but required in type 'NetMDFactoryService'.

461 class NetMDFactoryMockService implements NetMDFactoryService {
          ~~~~~~~~~~~~~~~~~~~~~~~

  src/services/interfaces/netmd.ts:299:5
    299     setDiscSwapDetection(enable: boolean): Promise<void>;
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    'setDiscSwapDetection' is declared here.

Found 3 errors in 2 files.

Errors  Files
     1  src/services/interface-service-manager.ts:90
     2  src/services/interfaces/netmd-mock.ts:447