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

[Bug]: Not working with esbuild (e.g. NG17) #765

Closed
Squixx opened this issue Nov 22, 2023 · 5 comments
Closed

[Bug]: Not working with esbuild (e.g. NG17) #765

Squixx opened this issue Nov 22, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@Squixx
Copy link

Squixx commented Nov 22, 2023

What happened?

In Angular 17, Esbuild is included as a compilation option (and default for new projects)

However when using the microsoft-cognitiveservices-speech-sdk, you will get the error:


✘ [ERROR] Could not resolve "net"

    (disabled):node_modules/.pnpm/https-proxy-agent@4.0.0/node_modules/https-proxy-agent/index.js:5:18:
      5 │ var net = require('net');
        ╵                   ~~~~~

  The package "net" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
  

as microsoft-cognitiveservices-speech-sdk depends on the https-proxy-agents and thus cant compile. (not this issue also applies when using the latest version of https-proxy-agents

Version

1.33.0 (Latest)

What browser/platform are you seeing the problem on?

Angular 17

Relevant log output

No response

@Squixx Squixx added the bug Something isn't working label Nov 22, 2023
@glharper
Copy link
Member

@Squixx Thank you for using JS Speech SDK, and writing this up. As http-proxy-agent provides core functionality for proxy support in our library, I can't give a timeline for replacement, nor can I assure you that any potential replacement will work with ESBuild, but I've added this bug to our backlog.

Internal ref. 5963384

@dabasejumper
Copy link

Is there no work around or additional feedback for this with Angular 17 projects?

@glharper
Copy link
Member

glharper commented Mar 23, 2024

Is there no work around or additional feedback for this with Angular 17 projects?

dotnet/aspnetcore#52082 (comment)

In this case, try adding "net": false.

@dabasejumper
Copy link

dabasejumper commented Mar 23, 2024

Thank you Glenn, that worked for in my case! Hopefully this issue is still on Microsoft's radar though for server rendering.

I also had to add the following to my angular.json file:
"allowedCommonJsDependencies": ["microsoft-cognitiveservices-speech-sdk"]

@glharper
Copy link
Member

glharper commented Apr 9, 2024

I'm closing this, as this issue is upstream of JS Speech SDK.

@glharper glharper closed this as completed Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants