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

Typescript errors when building #945

Open
palfaro91 opened this issue Feb 24, 2023 · 10 comments
Open

Typescript errors when building #945

palfaro91 opened this issue Feb 24, 2023 · 10 comments
Assignees
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@palfaro91
Copy link

Hello,
When I run the build command in an Adonisjs I get various Typescript errors that prevent build unless I ignore the errors

node_modules/@googlemaps/google-maps-services-js/src/client.ts:107:12 - error TS2345: 
Argument of type 'import("/Users/foolio/Sites/test-api/node_modules/@googlemaps/google-maps-services-js/node_modules/axios/index").AxiosInstance' is not assignable to parameter of type 'import("/Users/foolio/Sites/test-api/node_modules/axios/index").AxiosInstance'.
  Types of property 'defaults' are incompatible.
    Type 'AxiosDefaults<any>' is not assignable to type 'Omit<AxiosDefaults<any>, "headers"> & { headers: HeadersDefaults & { [key: string]: AxiosHeaderValue; }; }'.
      Type 'AxiosDefaults<any>' is not assignable to type 'Omit<AxiosDefaults<any>, "headers">'.
        Types of property 'adapter' are incompatible.
          Type 'AxiosAdapter | undefined' is not assignable to type 'AxiosAdapterConfig | AxiosAdapterConfig[] | undefined'.
            Type 'AxiosAdapter' is not assignable to type 'AxiosAdapterConfig | AxiosAdapterConfig[] | undefined'.
              Type 'import("/Users/foolio/Sites/test-api/node_modules/@googlemaps/google-maps-services-js/node_modules/axios/index").AxiosAdapter' is not assignable to type 'import("/Users/foolio/Sites/test-api/node_modules/axios/index").AxiosAdapter'.
                Types of parameters 'config' and 'config' are incompatible.
                  Type 'InternalAxiosRequestConfig<any>' is not assignable to type 'AxiosRequestConfig<any>'.
                    Types of property 'paramsSerializer' are incompatible.
                      Type 'ParamsSerializerOptions | undefined' is not assignable to type '((params: any) => string) | undefined'.
                        Type 'ParamsSerializerOptions' is not assignable to type '(params: any) => string'.
                          Type 'ParamsSerializerOptions' provides no match for the signature '(params: any): string'.

107 rax.attach(defaultAxiosInstance);
node_modules/@googlemaps/google-maps-services-js/src/client.ts:159:18 - error TS2345: Argument of type 'import("/Users/foolio/Sites/test-api/node_modules/@googlemaps/google-maps-services-js/node_modules/axios/index").AxiosInstance' is not assignable to parameter of type 'import("/Users/foolio/Sites/test-api/node_modules/axios/index").AxiosInstance'.
node_modules/@googlemaps/google-maps-services-js/src/client.ts:177:5 - error TS2322: Type 'null' is not assignable to type 'string[]'.
node_modules/@googlemaps/google-maps-services-js/src/directions.ts:215:45 - error TS2488: Type 'LatLng[] | undefined' must have a '[Symbol.iterator]()' method that returns an iterator.
node_modules/@googlemaps/google-maps-services-js/src/places/queryautocomplete.ts:20:3 - error TS6133: 'Place' is declared but its value is never read.

Thanks for stopping by to let us know something could be better!

Environment details

  1. Specify the API at the beginning of the title (for example, "Places: ...")
    I'm using this library in an Adonis Js project.

  2. OS type and version
    MacOs Monterey 12.5.1

  3. Library version and other environment information
    Version 3.3.27
    this version requires axios 0.27.2

Steps to reproduce

  1. In an Adonisjs project add a custom route and then run npm run build

Stack trace

Line numbers included in errors above.

@palfaro91 palfaro91 added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Feb 24, 2023
@wangela
Copy link
Member

wangela commented Feb 24, 2023

If you would like to upvote the priority of this issue, please comment below or react with 👍 so we can see what is popular when we triage.

@palfaro91 Thank you for opening this issue. 🙏
Please check out these other resources that might help you get to a resolution in the meantime:

This is an automated message, feel free to ignore.

@palfaro91
Copy link
Author

Any word?

@nora-soderlund
Copy link

nora-soderlund commented Mar 31, 2023

Until they've fixed it in the repository, you can revert all the breaking changes made by the dependency bot in your local environment.

The bot upgraded quite a lot of packages with major version updates, including breaking changes.

git checkout fb5dc053f685939a6493e43a8ac3a3529cc06696

@wangela wangela assigned amuramoto and unassigned wangela Mar 31, 2023
@palfaro91
Copy link
Author

Until they've fixed it in the repository, you can revert all the breaking changes made by the dependency bot in your local environment.

The bot upgraded quite a lot of packages with major version updates, including breaking changes.

git checkout fb5dc053f685939a6493e43a8ac3a3529cc06696

@nora-soderlund Thanks for the tip! So that would mean downgrading down to ^3.3.26 in package.json?

@amuramoto
Copy link
Member

This should be fixed in the latest release from this afternoon

@palfaro91
Copy link
Author

Hi @amuramoto I just updated my package to 3.3.37 and I'm still getting the same errors.

@palfaro91
Copy link
Author

palfaro91 commented Sep 9, 2023

@amuramoto I'm also using axios in my project and if I downgrade down to the same version that this package requires (0.27.2) the axios errors go away.

node_modules/@googlemaps/google-maps-services-js/src/client.ts:177:5 - error TS2322: Type 'null' is not assignable to type 'string[]'.

177     this.experienceId = null;

for this error it looks like the declaration should be updated to
private experienceId: string[] | null; if null should be an accepted value

for this error

node_modules/@googlemaps/google-maps-services-js/src/directions.ts:215:45 - error TS2488: Type 'LatLng[] | undefined' must have a '[Symbol.iterator]()' method that returns an iterator.

215     params.waypoints = ["optimize:true", ...params.waypoints];

For this error it looks like making waypoints optional is throwing the compiler off. It should be cast as an array

node_modules/@googlemaps/google-maps-services-js/src/places/queryautocomplete.ts:20:3 - error TS6133: 'Place' is declared but its value is never read.

20   Place,

It looks like the Place variable should be removed because it's not used

@palfaro91
Copy link
Author

@amuramoto so I'm also using axios in my project but using version 1.5.0. When I build my project it tries to use my version instead of the required version 0.27.2 and it looks like it's the axios-retry peer dependency that is causing it to use the root axios version


      "peerDependencies": {
        "axios": "*"
      }

@wangela wangela reopened this Sep 11, 2023
@wangela wangela added priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. and removed triage me I really want to be triaged. labels Sep 11, 2023
@palfaro91
Copy link
Author

Hi @wangela any word on this fix?

@palfaro91
Copy link
Author

Is this ever going to be fixed @wangela ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

4 participants