BundlerMinifier
BundlerMinifier copied to clipboard
Stack is empty, fails to minify
Installed product versions
- Visual Studio 2017 15.9.3032
- This extension: 2.8.391
Description
The extension fails to minify javascript files, the error is: "Stack is empty"
Steps to recreate
Download poppler.js 1.14.3, you can install from library manager
Current behavior
An error is generated ("Stack is empty") and poppler.js, is not minified, no output is generated.
Expected behavior
The file should be minified without problems, a poppler.min.js should be generated
Same with version 2.8.396 and 2.8.399. It fails to compile this function:
var renameObjKeys = function (obj, newKeys) {
const keyValues = Object.keys(obj).map(key => {
const newKey = newKeys[key] || key;
return { [newKey]: obj[key] };
});
return Object.assign({}, ...keyValues);
}
I have the same problem. The problem is the =>
syntax it does not like it for some reason.
change your code to this should work
var renameObjKeys = function (obj, newKeys) {
const keyValues = Object.keys(obj).map(function(key) {
const newKey = newKeys[key] || key;
return { [newKey]: obj[key] };
});
return Object.assign({}, ...keyValues);
}
I'm getting the same problem on Visual Studio 2019 16.2.4 and BundlerMinifier 2.8.396.
It seems like arrow functions were supposed to have been fixed a while ago according to #277 , but ... apparently not??
I'm Getting same Error The Problem is Related to (x)=>x.something
.map(x => x.Fields.BasePrice.StringValue);
Same problem on BundlerMinifier 2.8.396
Same problem here with Visual Studio Community 2019 v. 16.4.0 - extension v. 2.8.396
Same here. VS 2019 Pro. Web Essentials. v0.5.7
Same problem here, can confirm it's the "=>" syntax. Once I removed the occurrences it works as expected.
BundlerMinifier only supports ES5. I recommend you use https://babeljs.io/ to convert your javascript scripts to ES5 and replace the contents of your JS files
I tell you this because I see that you use ES6 features
FYI, as of today, BundleMinifier 3.2.435 is supporting =>
for me..
but it fails when the source map is enabled (if the file has =>
) with the Stack Empty error...
So turn off sourcemap.. no problem..
FYI, as of today, BundleMinifier 3.2.435 is supporting
=>
for me..but it fails when the source map is enabled (if the file has
=>
) with the Stack Empty error...So turn off sourcemap.. no problem..
The latest version is 2.8.396 as of this post so where do you see 3.2.x... ?
Thanks!
BundlerMinifier only supports ES5. I recommend you use https://babeljs.io/ to convert your javascript scripts to ES5 and replace the contents of your JS files
I tell you this because I see that you use ES6 features
why shouldn't I use ES6 features?
I've had nothing but problems when converting to other versions
Any chance this is going to be addressed? Use use source maps and I had to remove all instances of the arrow functions in my code to get around this problem. Not using ES6 doesn't seem a viable solution...
is this extension still being developed? the arrow function issues should be fixed soon
when defining custom @font-faces the compiled src is relative to the build folder. I have the font files in the same folder as the SCSSS files, but when compiled I get "src: url("../../STYLE/Layout/Poppins-Medium.ttf"); }"
Over two years and this is still a problem. Any chance it will ever get fixed?
Someone want to poke @madskristensen - this is now causing our Azure Devops to fail
Over two years and this is still a problem. Any chance it will ever get fixed?
In my amateur experience, by now it would be up to the rest of the community to fork this and fix it. I am no longer working on the project that used this, so I am not motivated, myself.
Over two years and this is still a problem. Any chance it will ever get fixed?
In my amateur experience, by now it would be up to the rest of the community to fork this and fix it. I am no longer working on the project that used this, so I am not motivated, myself.
We should we? This is the recommended solution, per Microsoft's documentation, to add bundling and minification to a Visual Studio project. If they aren't going to support it, then it should be either removed, or another solution added to VS. it's clear the author is just ignoring this issue.
@madskristensen Are you ever going to weigh in on this issue, on your project? This is causing Azure Devops deploys that depend on this package to fail. Or are you washed your hands of this package?
Perhaps Microsoft should assign this to someone who has an interest in fixing it.