Closed JeffMII closed 3 years ago
Thanks for bringing this to our attention. We are actively investigating and will get back to you soon.
Hello @JeffMII can you please share the Microsoft document you are referencing? We need to link the document to your post. Thanks.
Hello @JeffMII can you please share the Microsoft document you are referencing? We need to link the document to your post. Thanks.
I'm not sure if I understand exactly what you're asking for. Here is the link to the Azure Text Analytics documentation I used to get the app started:
Note that there has obviously been a recent update to the node package '@azure/ai-text-analytics' because in a separate learning project I did a couple months ago, the package I installed then is working fine in the current project. I simply copied the package from the old node_modules directory to the current node_modules directory and it works. So the problem isn't in any code I've written.
@aahill can you please review above feedback. Are you aware of any changes that may cause the error?
@Sintrias just to verify, did you specify the version as well? npm install --save @azure/ai-text-analytics@5.1.0-beta.5
@Sintrias just to verify, did you specify the version as well?
npm install --save @azure/ai-text-analytics@5.1.0-beta.5
I did not. The command I used to install the package is npm install @azure/ai-text-analytics
.
As far as I understand, this installs the latest version of a package.
Tried both and unable to reproduce the error.
Are you getting this error when you try to install the package or getting the error from a specific section of the code?
I can share my project with you. It is a work in progress though, so it doesn't fully compile even with the previous package version. It did however reach the next build stage after changing to the previous package version.
Are you getting this error when you try to install the package or getting the error from a specific section of the code?
When doing npm run start
. It is an Express project. Installing the package has no problems. I get the errors when trying to run the project using the above.
Also, I am using TSLint.
Hi @Sintrias. I work on the @azure/ai-text-analytics
package and I hope to be able to help resolving the issue you are seeing. If non of what my colleagues' suggestions worked, would you mind sharing a github repo to your Express project so I can take a closer look?
Upon further review, the issue seems to be based on the modules you are importing and the way you are importing them. I found a similar question that may help point you in the right direction. Also, checkout this thread. Hope it helps.
Ah. Those links are handling Angular projects. I'm very familiar with Angular. Neither of those will fix the issue however. NgModule is only recognized by Angular. The project I'm working on now is an Express project so NgModule won't be helpful here.
Hi @Sintrias. I work on the
@azure/ai-text-analytics
package and I hope to be able to help resolving the issue you are seeing. If non of what my colleagues' suggestions worked, would you mind sharing a github repo to your Express project so I can take a closer look?
I can. It's pretty late in the day at the moment so I will need to wait for tomorrow to share it with you. I'll be sure to create the repo first thing in the morning and share the pull request link with you.
@Sintrias no worries at all, I am looking forward to it!
@Sintrias no worries at all, I am looking forward to it!
Hey sorry. I haven't had the time to create the repo yet today. Just letting you know I haven't forgotten. I should have it by the end of the day.
So I just realized I'm using two of my accounts here. Sorry if anyone had some confusion. I created the github repo:
https://github.com/JeffMII/Azure-Text-Analytics-Debug.git
Just keep in mind that the app is still in progress so it doesn't compile even with the old '@azure/ai-text-analytics'. But, the error keeping me from progressing is the one we're discussing here. Thanks for the help.
I have updated the repo with code that fully compiles when using the previous version of ai-text-analytics. The error still happens with the latest version.
I'm not able to find the version number for the package that works. Can someone tell me what the last version number is so I can include it in my package.json? Thanks.
As I can tell, this is the update that's causing issues:
\node_modules\@azure\core-http\CHANGELOG.md
1.2.4 (2021-03-30)
- Rewrote
bearerTokenAuthenticationPolicy
to use a new backend that refreshes tokens only when they're about to expire and not multiple times before. This fixes the issue: 13369.
How can I get my package.json to specify the version that does not include the update to this part of the package?
Any updates?
Hi @Sintrias, thanks a lot for providing the github repo!
How can I get my package.json to specify the version that does not include the update to this part of the package?
I just tried and it seems like @azure/core-http@1.2.3
works fine so I think you can try npm install @azure/core-http@1.2.3 --save
to install it.
I opened this issue to track why @azure/core-http@1.2.4
causes a build failure in text analytics: https://github.com/Azure/azure-sdk-for-js/issues/15494.
Thanks for your patience! Please let me know if there is anything we can do to help!
Also, did you look into using our most recent beta package? You can try it by npm install @azure/ai-text-analytics@5.1.0-beta.6 --save
.
Thanks @deyaaeldeen I will give that a shot once I get back to my laptop. I'll let you know how it goes.
@Sintrias I did more debugging and it looks like the TypeScript compiler is trying to build the d.ts
files inside node_modules
which is causing the build failure. Looks like using the paths
option in your tsconfig.json
file caused this issue and when I removed it, the project built just fine with core-http@1.2.4. I hope that helps!
@Sintrias I did more debugging and it looks like the TypeScript compiler is trying to build the
d.ts
files insidenode_modules
which is causing the build failure. Looks like using thepaths
option in yourtsconfig.json
file caused this issue and when I removed it, the project built just fine with core-http@1.2.4. I hope that helps!
That did it! Nice. Thanks for the help. Weird though that I didn't have the same issue with the previous version.
I am glad that worked!
@GiftA-MSFT please close this issue now that it has been resolved.
I am learning the Azure AI Text Analytics API, and I've ran into a problem. The application is an Express app using Typescript. Here is the full error:
None of these files are my code so I don't really know what else I can share here. I have tried reinstalling the package twice using
npm uninstall @azure/ai-text-analytics
andnpm install @azure/ai-text-analytics
because it seemed to me that the error may have come from a bad install, but I still get the error.Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.