-
Notifications
You must be signed in to change notification settings - Fork 76
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
[Track2] Create ServiceClient failed: Class constructor ServiceClient cannot be invoked without 'new' #1004
Comments
I have analyzed the issue and am able to reproduce the issue. This issue happens only in the following case: With the new V6 Generator AND core V2 Libraries. Why?
As you can see above, the generated libraries are built with How to solve the issue? Option 2 @jeremymeng @xirzec I wanted to ask you if there is any specific reason that the @dw511214992 I will get Jeff, Jeremy and your opinion and decide on the final option and implement it. In the mean time, you could manually change the target of the generated libraries to @ramya-rao-a FYI.... |
Hi @sarangan12 In Option 1, you say we could change the target of |
Pretty sure webpack includes babel, which will transpile for most customers, even if picking the es2015. |
@dw511214992 Yes. Option 1 is to change the target of |
@ffMathy This change would impact both node and web scenarios. So, though dropping the support for es5 will not cause a big impact for web users (because of babel), the node only customers may still encounter an error. |
@sarangan12 people also use webpack for node projects. It's very rare that webpack is not used. |
@ffMathy Agreed. But, I still think we cannot make a design decision based on the assumption that the customers would be using something external. |
I believe we target es5 in core-http because we need to support IE11 for storage. |
Yes, the only reason we used es5 before was to support IE11, which hopefully will be a non-goal soon. So, I think our generated libraries should update their target to something more modern and in-line with our support matrix. |
Any timeframe on this? And is there a workaround while we wait? |
Awesome @sarangan12 - you're the best! ❤️ |
The PR #1027 has been merged. Code changes will be released in the next preview (which will be released before 06/15) |
@sarangan12 great news, but how would we use the preview from the commandline? 🙏 |
is there a way we can test this before preview ? |
@ffMathy After release if you use |
sarangan12 the beta version doesnt exists yet, or am I missing something ? |
@DavidNorena It is 'After the release'. The beta.3 version has not been released yet. It will be released on Tuesday |
@sarangan12 great! What is with the versioning though? Why is the alpha version 6.0.0? I'd assume it was a later version than the beta. |
Good question @ffMathy! The latest code generator goes by a new package name But there was another argument to be made that since it is a whole new package, it should be ok to start from v1. So you see v1 beta. We will finalize the versions soon, but am curious what your thoughts on the matter are :) |
Well I suppose it's fine if you clearly deprecate the old package and link to the new one. If you don't though, its version should be 7 in my opinion. |
Also @ramya-rao-a, if the new package started at 1.0, why does NPM list the 6.0 versions too? That's just even more confusing. In fact, I believe installing the package now with NPM would result in it fetching 6.0, because it it a later version. |
@ffMathy you do not need to install this package manually at all. Autorest will download whatever is tagged with latest on npm when you ask for the typescript code generator. You can confirm this by running the autorest command and inspect the printed log on the console for versions but make sure to not specify any versions in the arguments. That being said, I see your point that this could be confusing when looking at the npm website. @ramya-rao-a do you think it is ok to unpublish those alphas? |
Alright. I agree with unpublishing though. Also, what about the tags here? https://github.com/Azure/autorest.typescript/releases It says a 6.0.0 version was released relatively recently. That's super confusing as well. It also made me wonder if 6.0 was the active version. |
@ramya-rao-a you are very welcome! And great decision! I think that makes everything easier. Cheers! |
The latest "beta 3" release did not solve this for me. Here's the log output, proving it did in fact use the package.
|
I can also verify that the Can we re-open the issue? |
I have just verified it from scratch and can confirm the issue no longer happens. Let us go step by step:
I have followed the exact same steps and can confirm the issue does not happen. Would you mind trying it again and let me know if the issue still persists. |
reported by @colawwj
The text was updated successfully, but these errors were encountered: