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

Buffer is not defined [typescript] #4165

Closed
illunix opened this issue Feb 11, 2024 · 34 comments
Closed

Buffer is not defined [typescript] #4165

illunix opened this issue Feb 11, 2024 · 34 comments
Assignees
Labels
fixed type:bug A broken experience TypeScript Pull requests that update Javascript code
Milestone

Comments

@illunix
Copy link

illunix commented Feb 11, 2024

Hey, when I try send simple http get request I get this error, I use latest preview version where is mentioned that javascript is stable

image

@baywet
Copy link
Member

baywet commented Feb 12, 2024

Hi @illunix,
Thanks for using kiota and for reaching out.
Can you share with us which version of kiota and of the kiota dependencies and std uri template you are using please?

@baywet baywet added question TypeScript Pull requests that update Javascript code labels Feb 12, 2024
@baywet baywet added this to the Backlog milestone Feb 12, 2024
@illunix
Copy link
Author

illunix commented Feb 12, 2024

@baywet

"@microsoft/kiota-abstractions": "^1.0.0-preview.41",
"@microsoft/kiota-authentication-azure": "^1.0.0-preview.36",
"@microsoft/kiota-http-fetchlibrary": "^1.0.0-preview.40",
"@microsoft/kiota-serialization-form": "^1.0.0-preview.30",
"@microsoft/kiota-serialization-json": "^1.0.0-preview.41",
"@microsoft/kiota-serialization-multipart": "^1.0.0-preview.20",
"@microsoft/kiota-serialization-text": "^1.0.0-preview.38",

v1.11.1-preview.202402080001

@illunix
Copy link
Author

illunix commented Feb 12, 2024

And what do you mean by std uri template?

@baywet
Copy link
Member

baywet commented Feb 12, 2024

This one.
https://www.npmjs.com/package/@std-uritemplate/std-uritemplate (transitive through kiota-abstractions)
Can you run npm update -S and try again please? the dependencies are not on the latest version.

@illunix
Copy link
Author

illunix commented Feb 12, 2024

Right now I get this @baywet
[ERROR] TS2741: Property 'uriTemplate' is missing in type '{ responseBodyContentType: string; errorMappings: { 400: ParsableFactory<Parsable>; }; adapterMethodName: "sendCollectionAsync"; responseBodyFactory: (parseNode: : ParseNode | undefined) => (instance?: Parsable | undefined) => Record<...>; }' but required in type 'RequestMetadata'.

@illunix
Copy link
Author

illunix commented Feb 13, 2024

I updated to @baywet

"@microsoft/kiota-abstractions": "^1.0.0-preview.42",
"@microsoft/kiota-authentication-azure": "^1.0.0-preview.37",
"@microsoft/kiota-http-fetchlibrary": "^1.0.0-preview.41",
"@microsoft/kiota-serialization-form": "^1.0.0-preview.31",
"@microsoft/kiota-serialization-json": "^1.0.0-preview.42",
"@microsoft/kiota-serialization-multipart": "^1.0.0-preview.21",
"@microsoft/kiota-serialization-text": "^1.0.0-preview.39",

@illunix
Copy link
Author

illunix commented Feb 13, 2024

image
image

@illunix
Copy link
Author

illunix commented Feb 13, 2024

I don't understand how it's possible that I use latest released version and I get errors like this, how this even work? Does it pass the tests? Can someone explain?

@baywet
Copy link
Member

baywet commented Feb 14, 2024

Hi @illunix ,
Sorry about the confusion here, this is expected since #4148 has not been released yet.
At this point you can either:

  • wait until tomorrow afternoon EST for a new preview to come out.
  • grab the main branch and build kiota yourself.

After that, make sure you regenerate your client and everything will line up.

Typescript is still an experimental language at this point, we're working to make it stable but until then, misalignments like these might happen.

@illunix
Copy link
Author

illunix commented Feb 15, 2024

Okey so I've built the kiota main branch and this error does not appear anymore, but there is still with Buffer is not defined @baywet

image image

@baywet
Copy link
Member

baywet commented Feb 15, 2024

Thanks for confirming, and the stack trace is still the same? (coming from the std uri template library)

@illunix
Copy link
Author

illunix commented Feb 15, 2024

Yeah @baywet, it's same, is there any solution for that?

image

@illunix
Copy link
Author

illunix commented Feb 15, 2024

So just npm i @std-uritemplate/std-uritemplate or what you mean by explicit upgrade @andreaTP ?

@baywet
Copy link
Member

baywet commented Feb 15, 2024

npm i -S @std-uritemplate/std-uritemplate@latest to be exact

@baywet baywet added fixed Needs: Author Feedback and removed blocked This work can't be done until an external dependent work is done. labels Feb 15, 2024
@illunix
Copy link
Author

illunix commented Feb 15, 2024

Okey let me try

@illunix
Copy link
Author

illunix commented Feb 15, 2024

Actually it does not solve it @andreaTP

@baywet
Copy link
Member

baywet commented Feb 15, 2024

Can you run npm list @std-uritemplate/std-uritemplate and paste the output here? it sounds like an outdated version is still in use.

@illunix
Copy link
Author

illunix commented Feb 15, 2024

image

@baywet
Copy link
Member

baywet commented Feb 15, 2024

Thanks, so we'd need to publish a new version of the kiota libraries for this to take effect I guess. I think npm is not deduping it because it doesn't have at least a patch segment at the time in the version.

@illunix
Copy link
Author

illunix commented Feb 15, 2024

Are you able to do this today please?

@andreaTP
Copy link
Contributor

@illunix are you using NPM?
You should be able to override transitive dependencies as shown in this SO (I have done it in the past and it works nicely).

@baywet
Copy link
Member

baywet commented Feb 15, 2024

Additionally, I have put the bump PR together to unblock you as well as other users. Waiting for approval.

@illunix
Copy link
Author

illunix commented Feb 15, 2024

Okey so solution with override works fine @andreaTP

@illunix
Copy link
Author

illunix commented Feb 15, 2024

Thank you guys

@illunix illunix closed this as completed Feb 15, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in Kiota Feb 15, 2024
@baywet
Copy link
Member

baywet commented Feb 15, 2024

Additionally the PR was just merged and the publishing is ongoing. Expecting for it to finish in a couple of minutes.

@illunix
Copy link
Author

illunix commented Feb 15, 2024

Great, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed type:bug A broken experience TypeScript Pull requests that update Javascript code
Projects
Archived in project
Development

No branches or pull requests

3 participants