brackets-nodejs icon indicating copy to clipboard operation
brackets-nodejs copied to clipboard

Does not work with Minifier

Open sprintr opened this issue 10 years ago • 20 comments

I have installed Minifier extension. But your extension encounters an error with it.

sprintr avatar Aug 22 '14 15:08 sprintr

Could you please describe in more details what you're trying to do? I can't reproduce your issue.

Acconut avatar Aug 22 '14 18:08 Acconut

If I use your extension with the minifier extension installed as well, the terminal is completely blank. There is an error that is logged for main.js:197. It is because of function call to ansi.

The require('./ansi') somehow includes UglifyJS from the minifier extension. I had a workaround by putting ansi.js and preferences.js into the main.js.

If I don't install Minifier extension, it works fine that way.

sprintr avatar Aug 23 '14 07:08 sprintr

This is how the code was.

1-brackets-ui

Error logged to devTools 2-devtools

List of installed extensions. 3-installed-extension

require('./ansi') actually requires UglifyJS from minifier extension. 4-uglifyjs

sprintr avatar Aug 23 '14 07:08 sprintr

That's a wired one. I'm still not able to reproduce it. Are you using the latest version of Brackets?

Acconut avatar Aug 23 '14 13:08 Acconut

I am on 0.42. I have customized your extension for the fix. You can go ahead and close this issue for now.

sprintr avatar Aug 23 '14 14:08 sprintr

It might be a problem with require. I could not find it

sprintr avatar Aug 23 '14 14:08 sprintr

Is the extension able to require preferences.js? It would be interested to know if it's just a problem with ansi.js or require in general.

Acconut avatar Aug 23 '14 15:08 Acconut

No, it can't require preferences.js as well

sprintr avatar Aug 23 '14 16:08 sprintr

Have a look at this screenshot.

screenshot

sprintr avatar Aug 23 '14 16:08 sprintr

When I put ansi function from ansi.js into main.js, requiring prefs.js actually requires UglifyJS from minifier.

2014-08-23 21_37_33-greenshot

sprintr avatar Aug 23 '14 16:08 sprintr

If you don't mind, can I submit a PR that will fix this with my workaround and also some UI stuff?

sprintr avatar Aug 23 '14 16:08 sprintr

I have no clue what's going on here. To be honest, I don't want to merge ansi.js and preferences.js into main.js, I even want to split main.js into more files. UI improvements are always happily merged. :) Could you please try out other extensions and report the behavior to Brackets? To me, this doesn't seem like a problem with brackets-nodejs.

Acconut avatar Aug 23 '14 16:08 Acconut

Yes, I think that problem is either with brackets or require. I have fixed it for myself. I was think of using buttons instead of icons for the terminal.

sprintr avatar Aug 23 '14 16:08 sprintr

Please let me know about this issue, I would like to see what's problem in the end. We can talk about the UI stuff in another issue.

Acconut avatar Aug 23 '14 16:08 Acconut

I'll Investigate and let you know about it.

sprintr avatar Aug 23 '14 16:08 sprintr

Right now, the same happened to me. I'm now able to reproduce this issue and can start debugging it.

Acconut avatar Aug 26 '14 22:08 Acconut

I'm still unable to find why it happens.

sprintr avatar Aug 26 '14 23:08 sprintr

I too troubleshooted this same issue pretty hard, but came here before checking logs. I then removed minifier and now works as expected.

bitfed avatar Sep 07 '14 18:09 bitfed

Since I don't see any issue opened in adobe/brackets yet, I'll do it for myself.

Acconut avatar Sep 08 '14 09:09 Acconut

I opened an issue on brackets: adobe/brackets#9009 Please contribute any information if I missed something.

Acconut avatar Sep 08 '14 09:09 Acconut