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
Minify Error with async await #311
Comments
It seems the root cause of the problem is the absence of async / await support in NUglify package which is used for JavaScript code minification. And thus, the issue should be raised on NUglify project firstly. |
Done! trullock/NUglify#39 I experienced it yesterday too ;-) |
Seems like we have bunch of ES6 errors... any volunteers for tackling this issue? |
I am using bundler & minified with .net core 2.1 and vue.js and just added async functions, and the file is now has errors when processing in the Task Runner Explorer, I have the latest version, should this now work or is this an issue that still needs to be resolved? Do we need to not minify the file in the meantime? |
I just came across this. Maybe worth trying https://github.com/Shazwazza/Smidge/, which use Nuglify too, though I haven't checked to which operations (publicly stated are source maps). |
Does anyone know if the issue is purely waiting for Nuglify? and has anyone used Smidge? |
Given this comment by the owner, it seems Nuglify is somewhat no longer actively maintained: But hopefully any pull requests in the near future might fix the issue. Not sure if this is also actively maintained, but would be great if its was updated when Nuglify is updated or is updated to use another library that is maintained. Bundler & minified is great, but since starting to use async functions, its difficult to know if we need to try and move to something else or wait for a fix? |
If one is on .NET (and Razor) and uses TypeScript and on CSS3 (+ Grid etc.) to target whatever target, then using something from Nuget instead of WebPack might make sense. That's because there may not be a need to pull in something like Bootstrap and a SPA framework. Even more so in the future when Web Components and/or projects like lit-html/hyperHTML are more common. Some rationale to the casual lurker for the reasons these might feel important. |
@veikkoeeva : What does that mean? |
Hi @blogcraft I just realised this issue is 9 months old, are you still waiting for a fix or have you found another solution? Thanks. |
Version 1.5.12 of NUglify added support for async/await... I tried to download BundlerMinifier to create a pull request, but I were unable to even compile the project... |
Thank you for the update. Will you be updating the NuGet package also? |
Will this update make it into the Visual Studio Extention? |
This issue still exists with the latest version 2.9.408, I have async on a class as follows and the async doesn't get minified. Please advise. class UserConfig {
} |
Also facing this issue, using version 0.5.7 of Bundle&Minifier. |
What we ended up doing is removing the await from any HTTP method calls, since the wire trip on the Controller side is async, it seems to work. e.g. async getUserStuff(userId) { |
Yep, also had to do the same to get the errors to stop. |
Is this planned to be fixed sometime soon? |
I'm also facing this issue, is there any plan to fix it? Thanks in advance. |
Same issue here. Any due date for that ? |
Still an issue with the latest 3.2.435 release |
This is still an issue. Any update? |
Also seeing this still as an issue |
It seems that the extension is no longer supported as it is still at v2.8.396. If you disable the extension and use the package, the issue is fixed. |
I think this bug has returned. I am building today in october 24 2020 and the error is the same. |
Same here. It never worked for me. |
Just found the same issue and found a different workaround. The version of BundlerMinifier published on VS Marketplace (2.8.396) is very old and last updated on 24/08/2018 but there is a nightly build published on Open VSIX Gallery (3.2.457) which was updated 2 months ago and works with the async await issue reported here. It's a manual download from https://www.vsixgallery.com/extension/a0ae318b-4f07-4f71-93cb-f21d3f03c6d3/. Hope this helps folks struggling with ES6 JavaScript not minifying properly. |
Still doesn't support basic ES6 constructs. See: #537 |
The latest version of the BuildBundleMinifier nuget package 3.2.449 (from Mads Kristensen) - seems to fix this. Available via Nuget Package Manager in Visual Studio. |
Yes some of the ES6 issues have been addressed like the Async/Await but there are still issues with classes as shown here #537 |
I installed the latest BuildBundleMinifier nuget package, but it kept giving lots of JS errors "bundler & Minifier error 0: Strict-mode does not allow assignment to undefined variables:...." against the minified files complaining about undefined variables where in reality the variables are defined. I couldn't get around this so I had to uninstall it. Any help how to correct this behaviour will be appreciated. |
Installed product versions
Description
Error:
When minifing a java script file with
async
andawait
keywords, finds error.original unminified file works as expected in web browsers.
Steps to recreate
example:
Current behavior
Error appears and wont minify
Expected behavior
Should minify
The text was updated successfully, but these errors were encountered: