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

next(): Promise<IteratorResult<T,T>>; -> Method from core-paging is giving a error. #19394

Closed
6 tasks
sudeepghosh0 opened this issue Dec 16, 2021 · 18 comments
Closed
6 tasks
Assignees
Labels
Azure.Core bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close.

Comments

@sudeepghosh0
Copy link

  • @azure/core-paging/types/3.1/core-paging.d.ts:
  • "@azure/storage-blob": "^12.8.0":
  • Operating system:
  • nodejs
    • v.12.13.0:
  • browser
    • name/version:
  • typescript
    • version:
  • Is the bug related to documentation in

Describe the bug
A clear and concise description of what the bug is.

ERROR in ../node_modules/@azure/core-paging/types/3.1/core-paging.d.ts:16:21 - error TS2314: Generic type 'IteratorResult' requires 1 type argument(s).

16 next(): Promise<IteratorResult<T,T>>;

To Reproduce
Steps to reproduce the behavior:
1.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Dec 16, 2021
@ramya-rao-a
Copy link
Contributor

@sudeepghosh0 Can you please share a code snippet that can show how to reproduce the error?

@ramya-rao-a ramya-rao-a added Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files) labels Dec 16, 2021
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Dec 16, 2021
@EmmaZhu EmmaZhu added the needs-author-feedback Workflow: More information is needed from author to address the issue. label Dec 17, 2021
@sudeepghosh0
Copy link
Author

Steps to reproduce the error:-
Create a simple project in angular - 8.
Run - npm install @azure/storage-blob
Create a angular service and implement a uploadblob function.
When you are done with the above steps do "ng serve" and you should get the error.
Attaching my service file for reference.
sample-service-file.txt

@ghost ghost added needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team and removed needs-author-feedback Workflow: More information is needed from author to address the issue. labels Dec 20, 2021
@jeremymeng
Copy link
Member

jeremymeng commented Dec 20, 2021

The latest supported TypeScript version is 3.4.5 for Angular 8. We probably need to support more down-level versions like we did in #10599

@jeremymeng
Copy link
Member

Ah, we deleted our hand-crafted 3.1 type definition, and replaced it with the output of api-extractor #16732, which doesn't have the expected types. Look like downlevel-dts cannot handle the breaking changes in the type definitions.

@jeremymeng jeremymeng added Azure.Core bug This issue requires a change to an existing behavior in the product in order to be resolved. and removed Storage Storage Service (Queues, Blobs, Files) needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team labels Dec 20, 2021
@ghost ghost added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Dec 20, 2021
@jeremymeng jeremymeng removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team labels Dec 20, 2021
@jeremymeng jeremymeng assigned deyaaeldeen and unassigned EmmaZhu Dec 20, 2021
@jeremymeng
Copy link
Member

So we had had a hand-crafted core-paging.d.ts for 3.1 where we used IteratorResult<T>. After replaced it with downlevel-dts and api-extractor output, we now have IteratorResult<T,T> which isn't expected by lower versions (< 3.6) of TypeScript compiler

@deyaaeldeen
Copy link
Member

Hi @sudeepghosh0, thanks for filing this report! I created a fix in #19507. Until the fix is released, you can use this patched package.

Please let me know if you have any questions!

@deyaaeldeen deyaaeldeen added the issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. label Dec 22, 2021
@ghost
Copy link

ghost commented Dec 22, 2021

Hi @sudeepghosh0. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve” to remove the “issue-addressed” label and continue the conversation.

@sudeepghosh0
Copy link
Author

Thanks for the quick response.
can you please tell me how can i use the patched package in my project.
if i run "npm i @azure/[email protected]" its installing the old packages only.
" next(): Promise<IteratorResult<T, T>>;"

@deyaaeldeen
Copy link
Member

@sudeepghosh0 please download the tarball file from the link I shared above and then run npm install <path to the tarball file> in your NodeJS project directory.

@sudeepghosh0
Copy link
Author

Thank You.

@ramya-rao-a
Copy link
Contributor

@deyaaeldeen Please use the patched package only for testing and not in production. For your production usage, please wait for the official release which we should be able to get out in the first week of January 2022

@Leodecko
Copy link

Hello, is there a fix for this issue? I have the same problem.

@deyaaeldeen
Copy link
Member

@Leodecko Could you please share the version of @azure/core-paging installed in your project and the typescript compiler? v1.2.1 has the fix in #19507.

@Leodecko
Copy link

Leodecko commented Jan 19, 2022

Actually, the azure/storage-blob library is the one that is causing the issue I'm not using @azure/core-paging, the version of the storage-blob that we are using in our angular 8 protect is: 12.8.0
Thanks in advanced

@deyaaeldeen
Copy link
Member

Thanks @Leodecko for the information!

Could you please share the full error and the version of @azure/storage-blob you're using?

@Leodecko
Copy link

Leodecko commented Jan 19, 2022

image

When we try to build the app this is the error that is throwing us.
Our typescript version is : 3.5.3

@deyaaeldeen
Copy link
Member

@Leodecko thanks! The error is coming from core-paging which is one of the dependencies of @azure/storage-blob. @azure/[email protected] is the most recent version of that package and has a fix for this issue. Could you please upgrade the dependencies in your project by deleting the node_modules folder and running npm install again to install latest versions?

You can also try installing @azure/[email protected] explicitly by running npm install @azure/core-paging@^1.2.1.

Please let me know whether this solved the issue.

@maorleger
Copy link
Member

@Leodecko just FYI, Deya and I chatted and we want to recommend that instead of installing @azure/core-paging as a top-level dependency can you try the following:

# show the version of core-paging which I assume is 1.2.0 at this time
angular8 main % npm ls @azure/core-paging
[email protected] /home/mleger/workspace/azure-sdk-experiments/local/angular8
└─┬ @azure/[email protected]
  └── @azure/[email protected] 

# update @azure/core-paging to 1.2.1 (the latest) 
angular8 main % npm update @azure/core-paging

# show the version of core-paging again, which should be 1.2.1
angular8 main % npm ls @azure/core-paging
angular8 main % npm ls @azure/core-paging              
[email protected] /home/mleger/workspace/azure-sdk-experiments/local/angular8
└─┬ @azure/[email protected]
  └── @azure/[email protected] 

Hopefully that helps get you on a version of core-paging that contains the fix without deleting node_modules or your lock-file. let us know if that resolves your issues!

Just FYI - if nothing happens after you run npm update, you might be on an older version of npm and can try

npm update @azure/core-paging --depth 2

@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Core bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close.
Projects
None yet
Development

No branches or pull requests

7 participants