BundlerMinifier icon indicating copy to clipboard operation
BundlerMinifier copied to clipboard

Stack is empty, fails to minify

Open OrbintSoft opened this issue 6 years ago • 20 comments

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

OrbintSoft avatar Dec 13 '18 14:12 OrbintSoft

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);
}

MattePozzy avatar Dec 19 '18 08:12 MattePozzy

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);
}

MikeAlhayek avatar Sep 29 '19 00:09 MikeAlhayek

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??

Gavvers avatar Nov 07 '19 21:11 Gavvers

I'm Getting same Error The Problem is Related to (x)=>x.something

.map(x => x.Fields.BasePrice.StringValue);

babibn avatar Nov 11 '19 20:11 babibn

Same problem on BundlerMinifier 2.8.396

valeriob avatar Nov 13 '19 11:11 valeriob

Same problem here with Visual Studio Community 2019 v. 16.4.0 - extension v. 2.8.396

SteinTheRuler avatar Dec 10 '19 08:12 SteinTheRuler

Same here. VS 2019 Pro. Web Essentials. v0.5.7

RedBirdOBX avatar Dec 20 '19 18:12 RedBirdOBX

Same problem here, can confirm it's the "=>" syntax. Once I removed the occurrences it works as expected.

stap123 avatar Feb 07 '20 12:02 stap123

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

lauchacarro avatar Feb 26 '20 17:02 lauchacarro

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..

ghhv avatar Feb 27 '20 10:02 ghhv

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!

RedBirdOBX avatar Apr 09 '20 17:04 RedBirdOBX

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

SteinTheRuler avatar Apr 09 '20 22:04 SteinTheRuler

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...

jtsom avatar May 28 '20 17:05 jtsom

is this extension still being developed? the arrow function issues should be fixed soon

SteinTheRuler avatar May 28 '20 18:05 SteinTheRuler

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"); }"

SteinTheRuler avatar May 28 '20 19:05 SteinTheRuler

Over two years and this is still a problem. Any chance it will ever get fixed?

jtsom avatar Feb 26 '21 20:02 jtsom

Someone want to poke @madskristensen - this is now causing our Azure Devops to fail

jtsom avatar Mar 10 '21 18:03 jtsom

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.

Gavvers avatar Mar 10 '21 18:03 Gavvers

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.

jtsom avatar Mar 15 '21 12:03 jtsom

@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.

jtsom avatar Apr 03 '21 17:04 jtsom