duffelhq / duffel-api-javascript

JavaScript client library for the Duffel API

Home Page:https://duffel.com/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Version 2.5.2 : Cannot find module 'Client' or its corresponding type declarations

OliverCordingl1 opened this issue · comments

Attempting to build my project which uses the Duffel API, but getting the error:
Cannot find module 'Client' or its corresponding type declarations
multiple times in my compilation.

I went through some of the older Issues and found #372 on version 1.7, and after looking around I have a slight suspicion that relative paths have stopped being used since.

Could this be looked into please?

EDIT: Referenced the wrong issue

Here are the errors I received:


242     import { Client } from 'Client';
                               ~~~~~~~~

node_modules/@duffel/api/dist/typings.d.ts:903:28 - error TS2307: Cannot find module 'Client' or its corresponding type declarations.

903     import { Client } from 'Client';
                               ~~~~~~~~

node_modules/@duffel/api/dist/typings.d.ts:952:28 - error TS2307: Cannot find module 'Client' or its corresponding type declarations.

952     import { Client } from 'Client';
                               ~~~~~~~~

node_modules/@duffel/api/dist/typings.d.ts:1226:28 - error TS2307: Cannot find module 'Client' or its corresponding type declarations.

1226     import { Client } from 'Client';
                                ~~~~~~~~

node_modules/@duffel/api/dist/typings.d.ts:1289:32 - error TS2307: Cannot find module 'types' or its corresponding type declarations.

1289     import { OrderSlice } from 'types';
                                    ~~~~~~~

node_modules/@duffel/api/dist/typings.d.ts:3768:36 - error TS2307: Cannot find module 'types' or its corresponding type declarations.

3768     import { PaginationMeta } from 'types';
                                        ~~~~~~~

node_modules/@duffel/api/dist/typings.d.ts:3922:12 - error TS1038: A 'declare' modifier cannot be used in an already ambient context.

3922     export declare class Airlines extends Resource {
                ~~~~~~~

node_modules/@duffel/api/dist/typings.d.ts:4055:28 - error TS2307: Cannot find module 'Client' or its corresponding type declarations.

4055     import { Client } from 'Client';
                                ~~~~~~~~

node_modules/@duffel/api/dist/typings.d.ts:4123:28 - error TS2307: Cannot find module 'Client' or its corresponding type declarations.

4123     import { Client } from 'Client';

Hi, thank you for reporting your issue. I had a look and it looks like we weren't fully consistent with using the relative paths. I've made a PR here: #795

Meanwhile, just checking, are you using the latest version?

Hi, yes I was using the latest version