Skip to content
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

[BUG] Error while extracting custom-packages.zip #104

Closed
yoancutillas opened this issue Mar 25, 2024 · 14 comments
Closed

[BUG] Error while extracting custom-packages.zip #104

yoancutillas opened this issue Mar 25, 2024 · 14 comments

Comments

@yoancutillas
Copy link
Contributor

Describe the bug
Hi, I am sorry but since the new 3.5 version, the plugin install is failing with this error: Error while extracting (see screenshot below)

I have tried to install it manually, I have tried (and succeed) to manually extract the custom-packages.zip folder, but when booting Netbeans, the folder is automatically deleted, and the error shows again.

To Reproduce
The error occurs when on Netbeans start up, and when trying to minify a file (when a file is saved in my case).

Expected behavior
Minifierbeans should be updated without error.

Screenshots
minifierbeans-extract-error

Environment (please complete the following information):

  • OS: windows 11
  • NetBeans version: 21
  • JDK version: 21
@Chris2011
Copy link
Owner

Hi, please don't forget to update the title, [BUG] is not very helpful here. Since I investigate it I suggest you to use 3.4.0. If you figure out the problem, that would be cool. I also encountered a problem, that the extraction took veeeeeeery long. Maybe I will remove the package and just run "npm i" and hope that this is faster for most of the users. No custom logic. What do you think?

@yoancutillas yoancutillas changed the title [BUG] [BUG] Error while extracting .nbm Mar 25, 2024
@yoancutillas
Copy link
Contributor Author

yoancutillas commented Mar 25, 2024

Sorry I simply forgot the title ^^

I have tried to install 3.4 again, and encountered the same error.
I also tried with NetBeans 20 / JDK 18, same error.
That's very strange because I did install minifierbeans 3.4 on NetBeans 20 / JDK 18 / windows 11, successfully few months ago.

If extraction was the only problem, that would be fine, we can extract it manually.
But Netbeans deletes the "custom-packages" on startup and try to extract the zip file again.
Do you know how I can flag that "minifierbeans has been installed, do not try to install it again" in Netbeans config?

Edit: extraction took very long on my side too (with Windows' tool), sorry I don't know how it is possible to improve it.

@Chris2011 Chris2011 changed the title [BUG] Error while extracting .nbm [BUG] Error while extracting custom-packages.zip Mar 25, 2024
@Chris2011
Copy link
Owner

I think it comes from the udpate of the custom-packages maybe. NetBeans should not remove any after restart. It will check the folder and also checks the package.json from remote and from local to check the versions. It will only redownload the new package if the remote version is newer than the current local version.

I think it is better to get rid of the archive and the extraction progress and use the default behaviour just while using npm i or yarn. Manually extraction is also not an option because it is not very user friendly. It is just a workaround.

@yoancutillas
Copy link
Contributor Author

yoancutillas commented Mar 25, 2024

Ok, shame on me, the "custom-packages" folder was automatically deleted only because when I extracted the zip, it was extracted in a new folder: .netbeans/minifierbeans/custom-packages/custom-packages/, I didn't notice it until now. Unzipping custom-packages.zip manually does work.

Extracting manually is a workaround as you said, but at least, we have one way to make it work :)

Now, why Netbeans encounter an error while extracting the custom-packages.zip file, I don't know, I couldn't find any documentation or similar report on the web. Do you encounter the same issue on your side?

Edit: to reproduce the issue, you need to

  • uninstall minifierbeans from Tools > Plugins > Installed > Uninstall
  • install minifierbeans again manually from Tools > Plugins > Dowloaded > Add plugins
  • restart Netbeans

@Chris2011
Copy link
Owner

No, but I encountered the long taking task to unzip.

@yoancutillas
Copy link
Contributor Author

Ok, so that's a config issue on my side (don't know which one unfortunately), but the long taking task issue may be connected since both issues are related to extraction.
Let me know if you need me to test something.

@Chris2011
Copy link
Owner

You can try to identify the problem. It seems that is has smth todo with google-closure-compiler. Or smth else.

@Chris2011
Copy link
Owner

So try to manipulate the archive, remove smth from it also from package.json, etc. Whatever helps. It is now try and error. You also can tell me, how long it will take when you use yarn install or npm install.

@Chris2011
Copy link
Owner

I updated the custom-packages.zip which has kjust the files inside. The path needs to be .netbeasn/minifierbeans/custom-packages/.. Please test it.

@jshster
Copy link

jshster commented Mar 28, 2024

Apologies for the duplicate issue I created yesterday. Because it mentioned CLI error I thought it was different. Just like to add that extracting the custom-packages.zip into the .netbeans/miniferbeans/ folder worked for me too. Thanks.

@Chris2011
Copy link
Owner

@yoancutillas just lemme know whether that worked or we still need the workaround.

@SolracLeinad
Copy link

I'm using Debian and I had to unzip custom-packages.zip file to ~/.netbeans/minifierbeans/custom-packages/ but I additionally had to sed -i -e 's/\r$//' ~/.netbeans/minifierbeans/custom-packages/google-closure-compiler because I was getting the google-closure-compiler: bad interpreter: /bin/sh^M error.

It's working now.

@Chris2011
Copy link
Owner

So all in all, the first problem was, that I zipped the archive with a wrong compression strength. I just used windows zipping, before I used 7z with highest compression strength (9 - Ultra). The second problem was, that I removed the custom-packages folder from the zip and added the files to the root path which is wrong.

This is fixed in custom-packages 1.5.2 and it should work now out of the box, after opening NetBeans. If not, please empty the folder .netbeans/minifierbeans and restart NetBeans.

With Minifierbeans 3.5.1 I also increased the performance of extracting the archive.

@yoancutillas
Copy link
Contributor Author

Sorry I couldn't make the tests last week, but I confirm now that everything is working properly, thank you for your work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants